Residues of 2017

Let S S be the sum of all integers 1 n 2016 1 \leq n \leq 2016 that are quadratic residues modulo 2017. What are the last three digits of S S ?

  • You may use the fact that 2017 is a prime number.


The answer is 568.

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.

1 solution

Pranshu Gaba
Feb 14, 2016

This solution is adapted from two MathSE answers - Answer 1 and Answer 2

Observe that 2017 is a prime and is 1 mod 4. We will make use of properties of primes that are 1 mod 4.

Lemma: For any prime p 1 ( m o d 4 ) p \equiv 1 \pmod{4} , we see that 1 -1 is a quadratic residue mod p \text{mod } p .

Proof: We can make use of Wilson's theorem to prove this. We can write 1 ( p 1 ) ! ( 1 × 2 × 3 × × p 1 2 ) × ( p + 1 2 × × ( p 1 ) ) ( ( p 1 2 ) ! ) 2 × ( 1 ) p 1 2 ( ( p 1 2 ) ! ) 2 × 1 (Since p 1 2 is even.) ( ( p 1 2 ) ! ) 2 ( m o d p ) \begin{aligned} -1 & \equiv (p-1)! \\ & \equiv \left( 1 \times 2 \times 3 \times \cdots \times \frac{p-1}{2} \right) \times \left( \frac{p+1}{2} \times \cdots \times (p-1) \right)\\ & \equiv \left(\left( \frac{p-1}{2} \right)! \right)^{2} \times (-1)^{\frac{p-1}{2} } \\ & \equiv \left(\left( \frac{p-1}{2} \right)! \right)^{2} \times \color{#3D99F6}{1} ~~~~ \color{#3D99F6}{\text{(Since } \frac{p-1}{2} \text{ is even.)}} \\ & \equiv \left(\left( \frac{p-1}{2} \right)! \right)^{2} \pmod{p} \end{aligned}

We see that there exists an integer ( ( p 1 2 ) ! ) \left(\left( \frac{p-1}{2} \right)!\right) whose square is -1 mod p. Hence 1 -1 is a quadratic residue mod p. _\blacksquare


Since product of two residues is also a residue, for every residue a a , we see that a × ( 1 ) = a p a a \times (-1) = -a \equiv p - a is also a quadratic residue mod p. We can divide all residues of p p into pairs a a and p a p - a . The sum of each pair is a + p a = p a + p - a = p .

We know that any odd prime number has exactly p 1 2 \frac{p-1}{2} quadratic residues mod p, which means there are p 1 4 \frac{ p -1 }{4} pairs of residues. Each pair has sum of p p , therefore the total sum is p × p 1 4 p \times \frac{p-1}{4} .

In this problem, p = 2017 p = 2017 . There the sum is 2017 × 2017 1 4 = 2017 × 2016 4 = 2017 × 504 2017 \times \frac{ 2017 -1 }{ 4} = \frac { 2017 \times 2016 }{4} = 2017 \times 504 . We need to find its last three digits.

2017 × 504 17 × 504 ( m o d 1000 ) 8568 ( m o d 1000 ) 568 ( m o d 1000 ) \begin{aligned} 2017 \times 504 & \equiv 17 \times 504 \pmod{1000} \\ &\equiv 8568 \pmod{1000} \\ & \equiv 568 \pmod{1000} \\ \end{aligned}

The last three digits of the sum of residues is 568 \boxed{568} _\square

Moderator note:

What about the sum of quadratic residues of p = 4 k + 3 , k 2 p = 4k + 3 , k \geq 2 ? I believe that the answer is p k pk .

What about the sum of quadratic residues of p = 4 k + 3 , k 2 p = 4k + 3 , k \geq 2 ? I believe that the answer is p k pk .

Calvin Lin Staff - 5 years, 3 months ago

Log in to reply

Hmm.. a simple solution to this does not seem to exist. The sum of quadratic residues of p = 4 k + 3 p = 4k+3 is p k pk only for these primes: 3, 7, 11, 19, 43, 67 and 163. For all other primes, the sum is less than p k pk .

I have written a python code that outputs various properties of primes that are 3 m o d 4 3 \bmod{4} . I have analyzed it for some time, but I haven't been able to find any discernible pattern yet.

quadres.py (Right Click -> Save as...)

The same question is posted on this Math Forum page. I am not able to understand the Doctor's answer but what I do get is that the answer to this problem is probably not a simple one.

Pranshu Gaba - 5 years, 3 months ago

Log in to reply

Oh haha, fooled by trying small cases. Note that it doesn't work for 3 (which is why I put k 2 k \geq 2 ).

Ah yes, the class number of the quadratic field Q [ p ] \mathbb{Q} [ -p ] . That will involve quite a bit of machinery in Algebraic Number Theory for you to understand why that's the case.

Calvin Lin Staff - 5 years, 3 months ago

What do you mean by quadratic residue? There is really no clue for this in the question.

Janardhanan Sivaramakrishnan - 5 years, 3 months ago

Log in to reply

You can see the wiki page which I've just linked to.

Calvin Lin Staff - 5 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...