I have got a surprise for you
In honor of 7919 being the 1000th smallest prime number, we want to find the number of pairs of consecutive (positive) quadratic residues with respect to 7919 that are less than 7919.
Surprise : After solving the problem compare 7919 with your answer. Isn't is amazing?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The number of consecutive positive quadratic residues mod p that are less than p is 4 p − 5 if p ≡ 1 ( m o d 4 ) and 4 p − 3 if p ≡ 3 ( m o d 4 ) . So the answer is 4 7 9 1 9 − 3 = 1 9 7 9 .
To prove the general statement about quadratic residues, let C be the number of consecutive quadratic residues. Then consider x = 1 ∑ p − 1 ( ( p x ) + 1 ) ( ( p x + 1 ) + 1 ) . Here ( ⋅ ⋅ ) is the Legendre symbol .
When x and x + 1 are both quadratic residues, we get 4 . When one of them is a nonresidue, we get 0 . There is one more case: when x = p − 1 , we get ( p − 1 ) + 1 . So the conclusion is that 4 C + 1 + ( p − 1 ) = x = 1 ∑ p − 1 ( ( p x ) + 1 ) ( ( p x + 1 ) + 1 ) .
Expanding the sum on the right gives 4 C + 1 + ( p − 1 ) = x = 1 ∑ p − 1 ( p x ) ( p x + 1 ) + x = 1 ∑ p − 1 ( p x ) + x = 1 ∑ p − 1 ( p x + 1 ) + ( p − 1 ) . The second term is 0 , because there are 2 p − 1 residues and 2 p − 1 nonresidues. The third term is − 1 , because it is the same as the second term, except that it replaces ( p 1 ) = 1 with ( p p ) = 0 . Bringing everything to the left side gives 4 C + 3 − p + ( p − 1 ) = x = 1 ∑ p − 1 ( p x ) ( p x + 1 ) = x = 1 ∑ p − 1 ( p x 2 + x ) . But ( p x 2 + x ) = ( p x 2 ) ( p 1 + x − 1 ) = ( p 1 + x − 1 ) . As x ranges from 1 to p − 1 , so does x − 1 , so y = 1 + x − 1 ranges from 2 to p . We get 4 C + 3 − p + ( p − 1 ) = x = 1 ∑ p − 1 ( p 1 + x − 1 ) = y = 2 ∑ p ( p y ) = − 1 . So 4 C = p − 4 − ( p − 1 ) , which gives the result we had claimed.