OFFSET
1,3
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 residues of 7=prime(4) are 1, 2 and 4. Hence a(4)=1^2 + 2^2 + 4^2=21.
MATHEMATICA
Table[Total[ResourceFunction["QuadraticResidues"][Prime[n]]^2], {n, 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); t)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Nick Hobson, Nov 30 2006
STATUS
approved