OFFSET
1,3
COMMENTS
It seems that this is a nondecreasing sequence and a(n) < n for n >= 2.
Proofs of the above observations are provided in the Links below.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n + pi(n) - pi(n + pi(n)).
MAPLE
f:= n -> n + numtheory:-pi(n) - numtheory:-pi(n + numtheory:-pi(n)):
map(f, [$1..100]); # Robert Israel, Feb 12 2024
MATHEMATICA
pc[n_]:=With[{c=PrimePi[n]}, n+c-PrimePi[n+c]]; Array[pc, 70] (* Harvey P. Dale, Jan 18 2024 *)
PROG
(Python)
from sympy import primepi
print(1)
n = 2
for n in range(2, 10001):
n_f = n + primepi(n)
a = n_f - primepi(n_f)
print(a)
(PARI) a(n) = {my(x = n + primepi(n)); x - primepi(x); } \\ Michel Marcus, Oct 06 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Oct 06 2020
STATUS
approved