%I #18 Mar 18 2022 21:51:29
%S 0,1,2,3,4,5,7,10,6,8,11,14,15,19,25,33,9,12,16,20,21,26,34,43,27,35,
%T 44,55,56,70,88,110,13,17,22,28,29,36,45,57,37,46,58,71,72,89,111,137,
%U 47,59,73,90,91,112,138,169,113,139,170,207,208,253,307,371,18,23,30,38,39
%N Inverse permutation to A118462.
%H Alois P. Heinz, <a href="/A118463/b118463.txt">Table of n, a(n) for n = 0..12286</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%p g:= proc(n, i) option remember; `if`(n=0, [0], `if`(i<1, [], [seq(
%p map(p->p+2^(i-1)*j, g(n-i*j, i-1))[], j=0..min(1, n/i))]))
%p end:
%p b:= proc() local l, i; l:=[]; i:=0;
%p proc(n) while nops(l)<=n do
%p l:=[l[], sort(g(i, i))[]]; i:=i+1 od; l[n+1]
%p end
%p end():
%p a:= proc() local t, a; t, a:= -1, proc() -1 end;
%p proc(n) local h;
%p while a(n) = -1 do
%p t:= t+1; h:= b(t);
%p if a(h) = -1 then a(h):= t fi
%p od; a(n)
%p end
%p end():
%p seq(a(n), n=0..100); # _Alois P. Heinz_, Sep 06 2014
%Y Cf. A118462.
%K base,nonn,look
%O 0,3
%A _Franklin T. Adams-Watters_, Apr 28 2006