Lower-half quadratic-residue sum for primes congruent to seven modulo eight

ID: lower-half-quadratic-residue-sum-for-primes-congruent-to-seven-modulo-eight

For a prime number , let be the sum of the least positive quadratic residues below . Then
For example, at the relevant quadratic residues are , and their sum is .
To prove the identity, put , let be the sum of all least positive nonzero quadratic residues, and let count those above . The second supplementary law for quadratic reciprocity gives , so doubling permutes these residue classes. Reducing each doubled representative modulo subtracts exactly times. Hence , or .
Since , the first supplementary law for quadratic reciprocity says is a quadratic nonresidue. Exactly one of is therefore a quadratic residue for each . The lower-half choices sum to ; the upper-half choices sum to . Consequently
Substituting gives . Both congruence conditions have a role: one makes doubling a permutation, and the other makes each opposite pair contain exactly one quadratic residue.

New to topics? Read the docs here!