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.

Showing 1-1 of 1 results.

A339085 Number of primes p with n - pi(n) < p <= n + pi(n), where pi(n) is the number of primes <= n.

Original entry on oeis.org

0, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 4, 5, 6, 6, 5, 5, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10
Offset: 1

Views

Author

Ya-Ping Lu, Nov 23 2020

Keywords

Comments

a(n) >= 2 if n >= 2 and a(n) >= 3 if n is a prime >= 3 (see the paper by Ya-Ping Lu attached in the links).

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[n+PrimePi[n]]-PrimePi[n-PrimePi[n]],{n,85}] (* Stefano Spezia, Nov 24 2020 *)
  • Python
    from sympy import primepi
    for n in range(1, 101):
        m = primepi(n)
        print (primepi(n + m) - primepi(n - m))

Formula

a(n) = pi(n + pi(n)) - pi(n - pi(n)).
a(n) = A000720(n + A000720(n)) - A000720(n - A000720(n)).
a(n) = A000720(A095117(n)) - A000720(A062298(n)).
a(n) = A337788(n) + A338521(n) + isprime(n), where isprime(n) = 1 (if n is a prime) or 0 (if n is not a prime).
Showing 1-1 of 1 results.