OFFSET
1,2
COMMENTS
MATHEMATICA
Table[If[n<3, n, If[PrimeQ[n], n-NextPrime[n, -1], n+PrimePi[n]]], {n, 75}] (* James C. McMahon, Dec 19 2023 *)
PROG
(PARI) a(n) = if (isprime(n), n - precprime(n-1), n + primepi(n)); \\ Michel Marcus, Dec 18 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hendrik Kuipers, Dec 18 2023
STATUS
approved