A102066 Sum of the first n primes, mod 6.
2, 5, 4, 5, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 2, 3, 4, 5, 4, 3, 2, 3, 2, 3, 2, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3
Offset: 1
Examples
a(5) = 4 since (2+3+5+7+11) mod 6 = 4.
References
- H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.
Programs
-
Mathematica
Mod[Accumulate[Prime[Range[120]]],6] (* Harvey P. Dale, Jun 19 2014 *)
-
PARI
a(n) = sum(i=1, n, prime(i)) % 6 \\ Michel Marcus, Jul 12 2013
Formula
sum(p(n)) mod 6.
Extensions
More terms from Harvey P. Dale, Jun 19 2014
Comments