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.
LINKS
Nick Hobson, Table of n, a(n) for n = 1..1000
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