# Prove $\sum\limits_{j=1}^{p-1} j\left(\frac{j}{p}\right) = 0$ for an odd prime $p$ with $p\equiv 1\text{ mod } 4$

I want to show for an odd prime $p$ with $p\equiv 1\text{ mod } 4$, that

$$\sum\limits_{j=1}^{p-1} j\left(\frac{j}{p}\right) = 0$$

where $\left(\frac{j}{p}\right)$ is the Jacobi symbol. I got so far:

Let $w$ be a primitive root modulo $p$, then we get: $\sum\limits_{j=1}^{p-1} j\left(\frac{j}{p}\right) \equiv \sum\limits_{r=1}^{p-1} w^r\left(\frac{w^r}{p}\right) = \sum\limits_{j=1}^{p-1} w^r\cdot(-1)^r = \sum\limits_{j=1}^{p-1} (-w)^r = \sum\limits_{j=0}^{p-2} (-w)^r= \frac{(-w)^{p-1} -1}{-w-1} \equiv 0 \text{ mod } p$, where I used that $-w\neq1$ because then $p=3$, but $p\equiv 1\text{ mod } 4$ and in the last equation I used Fermat's Little Theorem. So how do I get $"=0"$ and not $"\equiv 0 \text{ mod } p"$?

• Think about $j(j/p)+(p-j)((p-j)/p)$. – Gerry Myerson Feb 5 '18 at 8:52
• $j\left(\frac{j}{p}\right) + (p-j) \left(\frac{p-j}{p}\right) = j\left(\frac{j}{p}\right) + (p-j) \left(\frac{-j}{p}\right) = j\left(\frac{j}{p}\right) + (p-j) \left(\frac{j}{p}\right) = p\left(\frac{j}{p}\right)$ because $p \equiv 1 \text{ mod } 4$. I think I don't get it. – mathcourse Feb 5 '18 at 9:03
• So far, so good. Now, $(j/p)$ is either $+1$ or $-1$, and each of those occurs the same number of times. So,.... – Gerry Myerson Feb 5 '18 at 9:20
• I can't see how this helps. – mathcourse Feb 5 '18 at 13:47

1. $\left(\frac{j}{p}\right)=\left(\frac{p-j}{p}\right)$ since $p\equiv1\bmod4$.
2. $\sum_1^{(p-1)/2}\left(\frac{j}{p}\right)=(1/2)\sum_1^{(p-1)/2}\left[\left(\frac{j}{p}\right)+\left(\frac{p-j}{p}\right)\right]=(1/2)\sum_1^{p-1}\left(\frac{j}{p}\right)=0$ since there are exactly as many quadratic residues as nonresidues modulo $p$.
3. $\sum_1^{p-1}j\left(\frac{j}{p}\right)=p\sum_1^{(p-1)/2}\left(\frac{j}{p}\right)=0$, where the first equation follows from the calculations in the comments on the question.