A266411 a(1) = 1, after which each a(n) = (A004074(n)+1)-th number selected from those not yet in the sequence.
1, 2, 4, 3, 6, 8, 7, 5, 10, 12, 14, 13, 16, 15, 11, 9, 18, 20, 22, 24, 23, 26, 28, 27, 30, 29, 25, 32, 31, 21, 19, 17, 34, 36, 38, 40, 42, 41, 44, 46, 48, 47, 50, 52, 51, 54, 53, 49, 56, 58, 57, 60, 59, 55, 62, 61, 45, 43, 64, 63, 39, 37, 35, 33, 66, 68, 70, 72, 74, 76, 75, 78, 80, 82, 84, 83, 86, 88, 90, 89, 92, 94, 93, 96, 95, 91
Offset: 1
Keywords
Links
Crossrefs
Programs
-
Mathematica
f[n_] := Block[{a = {1}, g, b = Range[2, n]}, g[1] = g[2] = 1; g[x_] := g[x] = g[g[x - 1]] + g[x - g[x - 1]]; Do[{AppendTo[a, #[[1, 1]]], Set[b, Last@ #]} &@ If[# > Length@ b, Break[], TakeDrop[b, {#}]] &@ (2 g[#] - # + 1) &@ k, {k, 2, n}]; a]; f@ 97 (* Michael De Vlieger, Dec 29 2015, Version 10.2, based on Harvey P. Dale at A004074 *)
Comments