OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers.
LINKS
EXAMPLE
Since 5 is prime, a(5) = a(4)th (3rd) smallest positive integer not occurring earlier in the sequence. The terms not occurring earlier in the sequence are 5,6,7,8,9,... and the 3rd of these is 7.
MATHEMATICA
Block[{a = {1}, nn = 71, s}, s = Range[2, 2 nn + 1]; Do[{AppendTo[a, First@ #1], Set[s, #2]} & @@ TakeDrop[s, If[CompositeQ@ i, 1, {a[[i - 1]]}]], {i, 2, nn}]; a] (* Michael De Vlieger, Sep 25 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 18 2005
EXTENSIONS
More terms from Franklin T. Adams-Watters, Nov 22 2006
STATUS
approved