A340763 Number of primes p <= n that are congruent to 1 modulo 3.
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 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, 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
Offset: 1
Examples
There are 11 primes <= 100 that are congruent to 1 modulo 3, namely 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, so a(100) = 11.
Links
- Jianing Song, Table of n, a(n) for n = 1..10000
Programs
-
PARI
a(n) = sum(i=1, n, isprime(i) && (i%3==1))