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
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
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Nov 01 2020
STATUS
approved