The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A339085 Number of primes p with n - pi(n) < p <= n + pi(n), where pi(n) is the number of primes <= n. 0
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
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).
LINKS
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).
MATHEMATICA
Table[PrimePi[n+PrimePi[n]]-PrimePi[n-PrimePi[n]], {n, 85}] (* Stefano Spezia, Nov 24 2020 *)
PROG
(Python)
from sympy import primepi
for n in range(1, 101):
m = primepi(n)
print (primepi(n + m) - primepi(n - m))
CROSSREFS
Sequence in context: A105528 A076225 A215776 * A140887 A132423 A071995
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Nov 23 2020
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 May 16 20:35 EDT 2024. Contains 372555 sequences. (Running on oeis4.)