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”).

A125613
Sum of the squares of the quadratic residues of prime(n).
6
1, 1, 17, 21, 132, 351, 816, 874, 1104, 4031, 3286, 8473, 11726, 11868, 11233, 24857, 28143, 38247, 46766, 40754, 66722, 65017, 83249, 120150, 156364, 173013, 152955, 184147, 218763, 245436, 297053, 327500, 437030, 413803, 556217, 488334, 652335
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.
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