OFFSET
1,3
FORMULA
a(n) = s(n) - prime(n)*q(n), where s(n) = sum of squares of first n primes, prime(n) is n-th prime and q(n) is floor(s(n)/prime(n)).
EXAMPLE
a[3] = 3 because s[3] = 2*2 + 3*3 + 5*5 = 38, p[3]=5 and q[3]= floor(38/5)=7, so a[3] = 38-5*7 = 3.
MATHEMATICA
Mod[#[[1]], #[[2]]]&/@With[{nn=70}, Thread[{Accumulate[Prime[ Range[ nn]]^2], Prime[Range[nn]]}]] (* Harvey P. Dale, Aug 09 2015 *)
PROG
(PARI) a(n) = sum(k=1, n, prime(k)^2) % prime(n); \\ Michel Marcus, Jan 14 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Randy L. Ekl, Jun 18 2002
STATUS
approved