login
A340764
Number of primes p <= n that are congruent to 2 modulo 3.
4
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,5
LINKS
FORMULA
A340763(n) + a(n) = A000720(n) - 1 for n >= 3.
EXAMPLE
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.
MATHEMATICA
Accumulate[Table[If[PrimeQ[n]&&Mod[n, 3]==2, 1, 0], {n, 90}]] (* Harvey P. Dale, May 12 2022 *)
PROG
(PARI) a(n) = sum(i=1, n, isprime(i) && (i%3==2))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jianing Song, Apr 28 2021
STATUS
approved