OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..901
MATHEMATICA
g[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1, k++ ]; k); NestList[ g, 7, 45 ]
With[{cmps=Select[Range[100000], CompositeQ]}, NestList[cmps[[#]]&, 7, 50]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 08 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved