OFFSET
0,3
COMMENTS
A permutation of the nonnegative integers.
A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 0..8192
EXAMPLE
The binary indices of 53 are {1,3,5,6}, with maximal runs ((1),(3),(5,6)) with lengths (1,1,2), which is the 14th composition in standard order, so A385889(53) = 14, and after removing duplicate rows a(16) = 14.
MATHEMATICA
bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n, 2]], 1];
stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
stcinv/@DeleteDuplicates[Table[Length/@Split[bpe[n], #2==#1+1&], {n, 0, 100}]]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Jul 18 2025
STATUS
approved
