A340764 Number of primes p <= n that are congruent to 2 modulo 3.
0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13
Offset: 1
Examples
There are 13 primes <= 100 that are congruent to 2 modulo 3, namely 2, 5, 11, 17, 23, 29, 41, 47, 53, 59, 71, 83, 89, so a(100) = 13.
Links
- Jianing Song, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Accumulate[Table[If[PrimeQ[n]&&Mod[n,3]==2,1,0],{n,90}]] (* Harvey P. Dale, May 12 2022 *)
-
PARI
a(n) = sum(i=1, n, isprime(i) && (i%3==2))