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
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, 18, 18, 23, 23, 25, 25, 27, 26, 28, 28, 28, 28, 30, 30, 32, 32, 32, 32, 35, 38, 38, 38, 39, 39, 39, 41, 42, 43, 42, 42, 42, 42, 42, 44, 49, 50, 49, 49, 54, 54, 56, 55, 55, 55, 57, 58 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
Eric Weisstein's World of Mathematics, Bertrand's Postulate
FORMULA
a(n) = primepi(2*prime(n))-n. - Charles R Greathouse IV, Aug 28 2014
a(n) = A060715(A000040(n)).
EXAMPLE
a(1)=1 because between p=2 and 4 there is exactly one prime, 3.
a(10)=6 since six consecutive primes (31,37,41,43,47,53) are located between p(10) = 29 and 58.
MAPLE
N:= 1000: # to get a(n) for n <= pi(N)
Primes:=select(isprime, [$1..N]):
seq(numtheory:-pi(2*Primes[n])-n, n=1..nops(Primes)); # Robert Israel, Aug 28 2014
MATHEMATICA
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 *)
PROG
(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
(PARI) a(n)=primepi(2*prime(n))-n \\ Charles R Greathouse IV, Aug 28 2014
CROSSREFS
Sequence in context: A076895 A282029 A029086 * A130120 A204892 A164512
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, May 05 2002
EXTENSIONS
Edited by N. J. A. Sloane, May 15 2008 at the suggestion of R. J. Mathar
STATUS
approved

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 18 10:01 EDT 2024. Contains 371779 sequences. (Running on oeis4.)