OFFSET
1,2
COMMENTS
For all n > 2, 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
Christian Aebi and Grant Cairns. Sums of Quadratic residues and nonresidues, arXiv preprint arXiv:1512.00896 [math.NT], 2015.
FORMULA
If prime(n) = 4k+1 then a(n) = k(4k+1) = A076409(n).
EXAMPLE
The quadratic nonresidues of 7=prime(4) are 3, 5 and 6. Hence a(4) = 3+5+6 = 14.
PROG
(PARI) vector(47, n, p=prime(n); t=1; for(i=2, (p-1)/2, t+=((i^2)%p)); p*(p-1)/2-t)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Nick Hobson, Nov 30 2006
STATUS
approved