Prove: Using the notation in Lemma 2, take d=2. It is easy to see that,
1⩽tj=2j<p/2,1⩽j<p/4p/2<tj=2j<p,p/4<j<p/2
From the second equation, we know
n=2p−1−[4p]
Therefore, we have
n={l,l+1,p=4l+1p=4l+3
From this and Lemma 2, we get
(p2)=(−1)n={1,−1,p≡±1(mod8)p≡±3(mod8)
This is the conclusion we want to prove. Equation (3) shows that 2 is a quadratic residue modulo p if and only if the prime p≡±1(mod8).
The significance of Lemma 2 lies in its linking whether d is a quadratic residue modulo p to the parity of the number n, where n is the number of dj (1⩽j⩽(p−1)/2), the smallest positive residues modulo p of the numbers 1,2,⋯,(p−1)/2 multiplied by d, that do not lie in 1,2,⋯,(p−1)/2. However, the properties of n itself are not well understood, nor is there an explicit formula for it. For this reason, further analysis of Lemma 2 and its proof is required. Using the notation of the integer part [x], equation (1) can be expressed as
jd=p[pjd]+tj,1⩽j<p/2
Summing both sides over j gives
dj=1∑(p−1)/2j=pj=1∑(p−1)/2[pjd]+j=1∑(p−1)/2tj=pT+j=1∑(p−1)/2tj
Here, T=∑j=1(p−1)/2[pjd]. From the proof of Lemma 2, we know
j=1∑(p−1)/2tj===s1+⋯+sk+r1+⋯+rns1+⋯+sk+(p−r1)+⋯+(p−rn)−np+2(r1+⋯+rn)j=1∑(p−1)/2j−np+2(r1+⋯+rn)
From the above two equations, we get
- 8p2−1(d−1)=p(T−n)+2(r1+⋯+rn).
When d=2, it is clear that T=0, and n≡(p2−1)/8(mod2), from which and Lemma 2, we again derive Theorem 3. When (d,2p)=1, we have
T≡n(mod2)
Thus, we obtain an explicit expression for n. From this and Lemma 2, the proof is completed.