login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A070046 Number of primes between prime(n) and 2*prime(n) exclusive. 7

%I #31 Oct 18 2022 13:44:10

%S 1,1,1,2,3,3,4,4,5,6,7,9,9,9,9,11,13,12,13,14,13,15,15,16,19,20,19,19,

%T 18,18,23,23,25,25,27,26,28,28,28,28,30,30,32,32,32,32,35,38,38,38,39,

%U 39,39,41,42,43,42,42,42,42,42,44,49,50,49,49,54,54,56,55,55,55,57,58

%N Number of primes between prime(n) and 2*prime(n) exclusive.

%H Robert Israel, <a href="/A070046/b070046.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BertrandsPostulate.html">Bertrand's Postulate</a>

%F a(n) = primepi(2*prime(n))-n. - _Charles R Greathouse IV_, Aug 28 2014

%F a(n) = A060715(A000040(n)).

%e a(1)=1 because between p=2 and 4 there is exactly one prime, 3.

%e a(10)=6 since six consecutive primes (31,37,41,43,47,53) are located between p(10) = 29 and 58.

%p N:= 1000: # to get a(n) for n <= pi(N)

%p Primes:=select(isprime,[$1..N]):

%p seq(numtheory:-pi(2*Primes[n])-n, n=1..nops(Primes)); # _Robert Israel_, Aug 28 2014

%t pp[n_]:=Module[{pr=Prime[n]},PrimePi[2pr]-n]; Array[pp,80] (* _Harvey P. Dale_, Mar 30 2015; edited by _Zak Seidov_, Oct 18 2022 *)

%o (PARI) forprime(p=2, 5000, n=0; for(q=p+1, 2*p-1, if(isprime(q), n++)); print1(n, ", ")) \\_Harry J. Smith_, Dec 13 2007, improved by _Colin Barker_, Aug 28 2014

%o (PARI) a(n)=primepi(2*prime(n))-n \\ _Charles R Greathouse IV_, Aug 28 2014

%Y Cf. A060715, A077463, A246514.

%K easy,nonn

%O 1,4

%A _Enoch Haga_, May 05 2002

%E Edited by _N. J. A. Sloane_, May 15 2008 at the suggestion of _R. J. Mathar_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 18:17 EDT 2024. Contains 371962 sequences. (Running on oeis4.)