OFFSET
1,2
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..100000
FORMULA
a(1) = 1; for n > 1, a(n) = 2 for prime n, and a(n) = 1+n-A000720(n) for composite n.
MATHEMATICA
Join[{1}, Table[If[PrimeQ[n], 2, 1+n-PrimePi[n]], {n, 2, 150}]] (* Harvey P. Dale, Jul 12 2019 *)
PROG
(PARI) A305800(n) = if(1==n, n, if(isprime(n), 2, 1+n-primepi(n)));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 14 2018
STATUS
approved