login
A065562
a(n) = b(n)-th highest positive integer not equal to any a(k), 1 <= k < n, where {b(n)} = 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, ... (sequence A002260).
4
1, 2, 4, 3, 6, 8, 5, 9, 11, 13, 7, 12, 15, 17, 19, 10, 16, 20, 22, 24, 26, 14, 21, 25, 28, 30, 32, 34, 18, 27, 31, 35, 37, 39, 41, 43, 23, 33, 38, 42, 45, 47, 49, 51, 53, 29, 40, 46, 50, 54, 56, 58, 60, 62, 64, 36, 48, 55, 59, 63, 66, 68, 70, 72, 74, 76, 44, 57, 65, 69, 73, 77
OFFSET
1,2
COMMENTS
Every positive integer occurs once and only once somewhere in this sequence.
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