A385889 The number k such that the k-th composition in standard order is the sequence of lengths of maximal runs of binary indices of n.
0, 1, 1, 2, 1, 3, 2, 4, 1, 3, 3, 5, 2, 6, 4, 8, 1, 3, 3, 5, 3, 7, 5, 9, 2, 6, 6, 10, 4, 12, 8, 16, 1, 3, 3, 5, 3, 7, 5, 9, 3, 7, 7, 11, 5, 13, 9, 17, 2, 6, 6, 10, 6, 14, 10, 18, 4, 12, 12, 20, 8, 24, 16, 32, 1, 3, 3, 5, 3, 7, 5, 9, 3, 7, 7, 11, 5, 13, 9, 17, 3
Offset: 0
Keywords
Examples
The binary indices of 27 are {1,2,4,5}, with maximal runs ((1,2),(4,5)), with lengths (2,2), which is the 10th composition in standard order, so a(27) = 10. The binary indices of 100 are {3,6,7}, with maximal runs ((3),(6,7)), with lengths (1,2), which is the 6th composition in standard order, so a(100) = 6.
Links
Crossrefs
Programs
-
Mathematica
bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1]; stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2; Table[stcinv[Length/@Split[bpe[n],#2==#1+1&]],{n,0,100}]
Comments