A026276 a(n) = a(m) if a(m) has already occurred exactly once and n = a(m) + m + 2, else a(n) = least positive integer that has not yet occurred.
1, 2, 3, 1, 4, 2, 5, 3, 6, 7, 4, 8, 9, 5, 10, 11, 6, 12, 7, 13, 14, 8, 15, 9, 16, 17, 10, 18, 11, 19, 20, 12, 21, 22, 13, 23, 14, 24, 25, 15, 26, 27, 16, 28, 17, 29, 30, 18, 31, 32, 19, 33, 20, 34, 35, 21, 36, 22, 37, 38, 23, 39, 40, 24, 41, 25
Offset: 1
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A009947.
Programs
-
Mathematica
a = {1}; Do[AppendTo[a, If[n == # + Position[a, #][[1, 1]] + 2, #, If[Length@ # == 0, Max@ a + 1, First@ #] &@ Complement[Range@ Max@ a, a]]] &@ Last@ SelectFirst[Transpose@ {Values@ #, Keys@ #}, Length@ First@ # == 1 &] &@ PositionIndex[a], {n, 2, 66}]; a (* Michael De Vlieger, Mar 22 2017, Version 10 *)
Comments