Let be an odd prime and a positive integer not divisible by . Then for each positive odd integer , let be
with , and let be the number of even s. Then
where is the Legendre symbol.
Let be an odd prime and a positive integer not divisible by . Then for each positive odd integer , let be
with , and let be the number of even s. Then
where is the Legendre symbol.
Weisstein, Eric W. "Gauss's Criterion." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/GausssCriterion.html