OFFSET
1,1
COMMENTS
By the Prime Number Theorem for arithmetic progressions, all nonzero residue classes are equiprobable. In particular, asymptotically, as m -> oo the Sum_{i=r..m} (prime(i) modulo k) = m*k/2. For this sequence this says Sum_{i=3..m} (prime(i) modulo 6) = m*3.
LINKS
A. Granville and G. Martin, Prime number races, arXiv:math/0408319 [math.NT], 2004.
EXAMPLE
For m = 17 we have Sum_{i=3..17} (prime(i) modulo 6) = 5 + 1 + 5 + 1 + 5 + 1 + 5 + 5 + 1 + 1 + 5 + 1 + 5 + 5 + 5 = 3*17.
MATHEMATICA
s = Accumulate[Mod[Select[Range[5, 200000], PrimeQ], 6]]; 2 + Position[s - 3 * Range[Length[s]], 6] // Flatten (* Amiram Eldar, Jul 13 2020 *)
PROG
(PARI) isok(m) = sum(i=3, m, prime(i)%6) == 3*m; \\ Michel Marcus, Jul 13 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Jul 13 2020
EXTENSIONS
More terms from Michel Marcus, Jul 13 2020
STATUS
approved