cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A063124 a(n) = # { primes p | prime(n) <= p < 2*prime(n) } where prime(n) is the n-th prime.

Original entry on oeis.org

2, 2, 2, 3, 4, 4, 5, 5, 6, 7, 8, 10, 10, 10, 10, 12, 14, 13, 14, 15, 14, 16, 16, 17, 20, 21, 20, 20, 19, 19, 24, 24, 26, 26, 28, 27, 29, 29, 29, 29, 31, 31, 33, 33, 33, 33, 36, 39, 39, 39, 40, 40, 40, 42, 43, 44, 43, 43, 43, 43, 43, 45, 50, 51, 50, 50, 55, 55, 57, 56, 56, 56, 58
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 08 2001

Keywords

Comments

a(n) is the number of primes between prime(n) and 2*prime(n) inclusive. - Sean A. Irvine, Apr 18 2023
Also for x = Product_{i=n..n+k} A000040(i), the least k such that A003961(x) > 2*x. - Antti Karttunen, Dec 08 2024

Examples

			a(10) = 7 as there are 7 primes between prime(10) = 29 and 58 = 29*2: 29, 31, 37, 41, 43, 47, 53.
		

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • Maple
    A062134 := proc(n) numtheory:-pi(2*ithprime(n))-n+1; end; # N. J. A. Sloane, Oct 19 2024
    [seq(A062134(n),n=1..100)];
  • Mathematica
    Table[PrimePi[2*Prime[n]] - n + 1, {n, 100}] (* Paolo Xausa, Oct 22 2024 *)
  • PARI
    a(n)={1 + primepi(2*prime(n)) - n} \\ Harry J. Smith, Aug 19 2009

Formula

a(n) = A035250(prime(n)).
a(n) = A070046(n) + 1. - Sean A. Irvine, Apr 18 2023
From Antti Karttunen, Dec 08 2024: (Start)
a(n) = n-A331677(n) = 1+n-A334051(n).
a(n) = 1+A000720(2*A000040(n))-n. [After Harry J. Smith's PARI-program]
a(n) < A108227(n). [Assuming M. F. Hasler's interpretation in May 08 2017 comment in the latter]
a(n) = A001222(A378746(n)).
(End)

Extensions

Definition clarified by N. J. A. Sloane, Oct 04 2024