OFFSET
1,1
LINKS
C. Popescu, Problem 10852, American Mathematical Monthly, Vol. 108 (2001), p. 171.
C. Popescu, Roy Barbara and Omran Kouba, A Sum Related to Quadratic Residues: 10852, American Mathematical Monthly, Vol. 109 (2002), p. 208.
FORMULA
a(n) = Sum_{k=1..(p-1)/2} floor(k^2/p+1/2) where p is n-th prime congruent to 7 mod 8 (i.e. A007522(n)).
a(n) = (A007522(n)^2 - 1)/24. See 2nd link. - Michel Marcus, Dec 12 2017
EXAMPLE
For n=2, p=A007522(2)=23, so a(2)=0+0+0+1+1+2+2+3+4+4+5=22.
PROG
(PARI) lista(nn) = {forprime(p=2, nn, if ((p % 8) == 7, print1((p^2-1)/24, ", ")); ); } \\ Michel Marcus, Dec 12 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Marc LeBrun, Feb 27 2001
STATUS
approved