[Math] the sum of the quadratic residues of prime $p=4k + 3$

elementary-number-theory

If prime $p=4k + 1$ we know that if a is a quadratic residue then $-a$ is a quadratic residue, So there are $(p – 1)/4$ pairs of integers whose sum is $p$. So the sum over all quadratic residues is $p(p-1)/4 = (4k + 1)k$.
Summing the quadratic residues over a prime $p=4k + 3$ seems to be much more difficult. The sums are given in Sloane's OEIS A076409. Is it possible to give a simple proof of the sums (for $p = 4k +3$) being congruent to $0 (\text{mod }p)$? Here I am assuming they are congruent to $0 (\text{mod }p)$ based on emperical evidence.

Best Answer

More direct, but less elegant than darij's proof:

We have $\sum_{k=1}^{p-1} k^2 = \frac{p(p-1)(2p-1)}{6}$. This sum has each quadratic residue repeated twice, so, assuming $p\neq 2$, the sum of the quadratic residues is $\frac{p(p-1)(2p-1)}{6} \cdot 2^{-1} \pmod{p}$. If $p\neq 3$, this is clearly $0\pmod{p}$.