login
Number of primes p <= n that are congruent to 1 modulo 3.
3

%I #15 Jun 10 2021 12:22:08

%S 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,

%T 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,

%U 8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10

%N Number of primes p <= n that are congruent to 1 modulo 3.

%H Jianing Song, <a href="/A340763/b340763.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) + A340764(n) = A000720(n) - 1 for n >= 3.

%e 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.

%o (PARI) a(n) = sum(i=1, n, isprime(i) && (i%3==1))

%Y Cf. A002476, A340764, A172104, A066339, A066490.

%K nonn,easy

%O 1,13

%A _Jianing Song_, Apr 28 2021