login
Number of primes in the interval (n,3n].
3

%I #20 Feb 28 2024 11:56:04

%S 2,2,2,3,3,4,4,5,5,6,6,6,6,7,8,9,8,9,8,9,10,10,10,11,12,12,13,14,13,

%T 14,13,13,14,15,16,17,17,18,18,18,17,17,17,18,18,19,19,19,19,20,21,21,

%U 21,21,22,23,23,24,23,24,24,24,24,25,26,27,27,27,27,27,27,27,26,26,27,28

%N Number of primes in the interval (n,3n].

%C Differences a(n+1)-a(n) are 0, 1 or -1.

%H Alois P. Heinz, <a href="/A074990/b074990.txt">Table of n, a(n) for n = 1..10000</a>

%H M. Das, G. Paul, <a href="https://arxiv.org/abs/1710.09891">Generalization of Bertrand's Postulate and Upper Bounds on the Number of Primes in Certain Intervals</a>, arXiv:1710.09891 [math.NT], 2017.

%F a(n) = A000720(3n) - A000720(n).

%F a(n) = Sum_{j=n+1..3*n} A010051(j).

%e a(4) = 3 because between 4 and 12 there are 3 primes: 5, 7, 11; a(7) = 4 because between 7 and 21 there are 4 primes: 11, 13, 17, 19.

%p A074990 := proc(n)

%p numtheory[pi](3*n)-numtheory[pi](n) ;

%p end proc: # _R. J. Mathar_, Nov 03 2017

%t s=3; a[n_] := PrimePi[s*n]-PrimePi[n]

%Y Cf. A000040, A000720, A010051, A108954, A075699.

%K nonn

%O 1,1

%A _Zak Seidov_, Oct 02 2002