OFFSET
1,1
COMMENTS
The prime/nonprime compound sequence ABB. - N. J. A. Sloane, Apr 06 2016
EXAMPLE
Nonprime(4) = 8.
The 8th prime is 19, the second entry.
MAPLE
For Maple code for the prime/nonprime compound sequences (listed in cross-references) see A003622. - N. J. A. Sloane, Mar 30 2016
MATHEMATICA
nonPrime[n_Integer] := FixedPoint[n + PrimePi[ # ] &, n]; Prime /@ nonPrime /@ nonPrime /@ Range[54] (* Robert G. Wilson v, Feb 04 2005 *)
PROG
(PARI) \We perform nesting(s) with a loop. cips(n, m) = { local(x, y, z); for(x=1, n, z=x; for(y=1, m+1, z=composite(z); ); print1(prime(z)", ") ) } composite(n) = \ The n-th composite number. 1 is defined as a composite number. { local(c, x); c=1; x=0; while(c <= n, x++; if(!isprime(x), c++); ); return(x) }
CROSSREFS
KEYWORD
nonn
AUTHOR
Cino Hilliard, Jan 31 2005
EXTENSIONS
Edited by Robert G. Wilson v, Feb 04 2005
STATUS
approved