[Math] Sum of squared quadratic non-residues

elementary-number-theory

Can you prove that if $p$ is a prime greater than $5$, then the sum of the squares of the quadratic nonresidues modulo $p$ is divisible by $p$?

Note that I have just proved that the sum of the quadratic residues modulo $p$ is divisible by $p$ for $p$ greater than $3$.

Best Answer

Let $g$ be a primitive root of $p$. Then the non-resuidues are congruent to the odd powers of $g$. Thus their squares are congruent to $g^2$, $g^6$, $g^{10}$, and so on up to $g^{2p-4}$. Add. We get that if $S$ is the sum, then $$(g^4-1)S \equiv g^2(g^{2(p-1)}-1) \pmod{p}.\tag{1}$$

The right-hand side is congruent to $0$ by Fermat's Theorem. If $p\gt 5$ then $g^4-1\not\equiv 0\pmod{p}$. It follows from (1) that $S\equiv 0\pmod{p}$.

Related Question