login
A232560
Inverse permutation of the sequence of positive integers at A232559.
5
1, 2, 3, 4, 6, 5, 8, 7, 11, 10, 16, 9, 14, 13, 21, 12, 19, 18, 29, 17, 27, 26, 42, 15, 24, 23, 37, 22, 35, 34, 55, 20, 32, 31, 50, 30, 48, 47, 76, 28, 45, 44, 71, 43, 69, 68, 110, 25, 40, 39, 63, 38, 61, 60, 97, 36, 58, 57, 92, 56, 90, 89, 144, 33, 53, 52
OFFSET
1,2
MAPLE
g:= proc() local l, s; l, s:= [1], {1}:
proc(n) option remember; local i, r; r:= l[1];
l:= subsop(1=NULL, l);
for i in [1+r, r+r] do if not i in s then
l, s:=[l[], i], s union {i} fi
od; r
end
end():
a:= proc() local t, a; t, a:= 0, proc() -1 end;
proc(n) local h;
while a(n) < 0 do
t:= t+1; h:= g(t);
if a(h) < 0 then a(h):= t fi
od; a(n)
end
end():
seq(a(n), n=1..100); # Alois P. Heinz, Sep 14 2021
MATHEMATICA
z = 12; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1]]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]] (* A232559 *)
Table[Length[g1[n]], {n, 1, z}] (* Fibonacci numbers *)
t1 = Flatten[Table[Position[t, n], {n, 1, 200}]] (* A232560 *)
CROSSREFS
Sequence in context: A265734 A299759 A372030 * A183090 A232559 A094138
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Nov 26 2013
STATUS
approved