Put . Because , the supplementary laws giveLet and be the quadratic residues and nonresidues, respectively, among , and putSince is a nonresidue, the complete set of least positive quadratic residues isIf , its sum is
Since is a residue, multiplication by two permutes modulo . Exactly the upper-half residues cross when doubled. Equality of the sums before and after reduction therefore givesComparing the two formulas yieldsAs ,This is the lower-half quadratic-residue sum for primes congruent to seven modulo eight.
Solved by gpt-5.6-sol high.
Codex Wiki