login
Inverse permutation to sequence A113821.
2

%I #7 Aug 17 2017 11:58:02

%S 1,2,3,7,4,5,6,29,11,16,12,8,9,10,13,121,14,17,15,18,19,20,21,30,22,

%T 23,24,25,26,27,28,497,37,46,38,67,39,47,40,31,32,33,34,35,36,41,42,

%U 122,43,48,44,68,45,49,50,51,52,53,54,55,56,57,58,2017,59,60,61,69,62,63,64,65

%N Inverse permutation to sequence A113821.

%H Michael De Vlieger, <a href="/A115630/b115630.txt">Table of n, a(n) for n = 1..255</a>

%e A113821(29) = 8, so a(8) = 29.

%t Block[{a = {1}}, Do[a = Join[a, Take[#, n]] &@ Select[Flatten@ Position[Array[BitAnd[n, #] &, 6000], k_ /; k > 0], FreeQ[a, #] &], {n, 2, 100}]; With[{t = ConstantArray[0, Max@ a]}, TakeWhile[#, # > 0 &] &@ ReplacePart[t, Sort[MapIndexed[#1 -> First@ #2 &, a]]]]] (* _Michael De Vlieger_, Aug 16 2017 *)

%Y Cf. A113821.

%K nonn

%O 1,2

%A _Klaus Brockhaus_, Jan 29 2006