OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
EXAMPLE
a(1) = 2-(-1)^0 = 1. a(2) = 3-(-1)^1=4.
MATHEMATICA
nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n];
Table[Prime[n + 1] - (-1)^(nonPrime[n]), {n, 0, 50}] (* G. C. Greubel, Aug 24 2017 *)
Module[{nn=200, np, pr, len}, np=Select[Range[0, nn], !PrimeQ[#]&]; len= Length[ np]; #[[1]]-(-1)^#[[2]]&/@Thread[{Prime[Range[len]], np}]] (* Harvey P. Dale, Jan 24 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Aug 07 2009
EXTENSIONS
Entries checked by R. J. Mathar, Oct 10 2009
STATUS
approved