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.

A337788 The number of primes between n exclusive and n+primepi(n) inclusive.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4, 4, 5, 5, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 5, 4, 4, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 4, 5, 5, 6, 6
Offset: 1

Views

Author

Ya-Ping Lu, Oct 27 2020

Keywords

Comments

There is at least one prime number in the range of (n, n + primepi(n)], or a(n) >= 1, for n >= 2 (see Corollary 1 in the paper by Ya-Ping Lu attached in the links).
See also the Panaitopol link. - Charles R Greathouse IV, Jul 12 2024

Crossrefs

Programs

  • Mathematica
    Table[Count[Range[n+1,n+PrimePi[n]],?PrimeQ],{n,90}] (* _Harvey P. Dale, Aug 28 2024 *)
  • PARI
    a(n) = primepi(n+primepi(n)) - primepi(n); \\ Michel Marcus, Oct 27 2020
  • Python
    from sympy import primepi
    for n in range(1, 101):
        pi = primepi(n)
        a = primepi(n + pi) - pi
        print(a)
    

Formula

a(n) = primepi(n + primepi(n)) - primepi(n)
a(n) = A000720(n + A000720(n)) - A000720(n)
a(n) = A000720(A095117(n)) - A000720(n)