login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A125617
Sum of the squares of the quadratic nonresidues of prime(n).
2
0, 4, 13, 70, 253, 299, 680, 1235, 2691, 3683, 6169, 7733, 10414, 13717, 22278, 23373, 38586, 35563, 51255, 76041, 60298, 96222, 103916, 110894, 143172, 165337, 206000, 218494, 206991, 229164, 377698, 413305, 410726, 471766, 535357, 647941, 625331
OFFSET
1,2
COMMENTS
For all n > 3, prime(n) divides a(n).
REFERENCES
D. M. Burton, Elementary Number Theory, McGraw-Hill, Sixth Edition (2007), p. 185.
EXAMPLE
The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = 3^2 + 5^2 + 6^2 = 70.
MATHEMATICA
Table[Total[Complement[Range[p-1], Union[Table[PowerMod[k, 2, p], {k, p}]]]^2], {p, Prime@Range[37]}] (* James C. McMahon, Dec 19 2024 *)
PROG
(PARI) vector(37, n, p=prime(n); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)^2); p*(p-1)*(2*p-1)/6-t)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Nick Hobson, Nov 30 2006
STATUS
approved