OFFSET
1,2
COMMENTS
Every positive integer occurs once and only once somewhere in this sequence.
LINKS
EXAMPLE
b(6) = 3, so a(6) = 8 = 3rd-highest positive integer not equal to 1, 2, 4, 3, or 6 (the values of a(k), 1 <= k < 6).
MATHEMATICA
Block[{a = {1}, s = Rest@ Range[96], r}, r = Flatten@ Map[Range, {1}~Join~Differences@ Most@ Reap[Do[If[Sow[PolygonalNumber@ i] > Last@ s, Break[]], {i, Infinity}]][[-1, 1]] ]; Do[AppendTo[a, s[[r[[i]] ]]]; s = Complement[s, a], {i, 2, 3 Max[s]/4}]; a] (* Michael De Vlieger, Sep 23 2017 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Leroy Quet, Nov 29 2001
STATUS
approved