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!)
A338521 The number of primes between n-primepi(n) and n. 1
0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 1, 1, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 4, 4, 4, 4, 3, 3, 4, 4, 4, 3, 3, 3, 3, 3, 4, 4, 4, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
COMMENTS
There is at least one prime number between n-primepi(n) and n, or a(n) >= 1, for n >= 3 (see Corollary 3 in the paper by Ya_Ping Lu attached in the links).
LINKS
FORMULA
a(n) = primepi(n - 1) - primepi(n - primepi(n)).
a(n) = A000720(n - 1) - A000720(n - A000720(n)).
a(n) = A000720(n -1) - A000720(A062298(n)).
MATHEMATICA
Array[Subtract @@ Map[PrimePi, {#1 - 1, #1 - #2}] & @@ {#, PrimePi[#]} &, 105] (* Michael De Vlieger, Nov 05 2020 *)
PROG
(Python)
from sympy import primepi
for n in range(1, 101):
pi = primepi(n)
pi_1 = primepi(n - 1)
a = pi_1 - primepi(n - pi)
print(a)
(PARI) a(n) = primepi(n - 1) - primepi(n - primepi(n)); \\ Michel Marcus, Nov 01 2020
CROSSREFS
Sequence in context: A352085 A036541 A176505 * A036225 A236859 A278401
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Nov 01 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 April 24 15:57 EDT 2024. Contains 371961 sequences. (Running on oeis4.)