OFFSET
0,7
COMMENTS
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.
EXAMPLE
Composition number 741 in standard order is (2,1,1,3,2,1), with even bisection (1,3,1), which is composition number 25 in standard order, so a(741) = 25.
MATHEMATICA
Table[Total[2^Accumulate[Reverse[Last/@Partition[ Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse, 2]]]]/2, {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Aug 19 2021
STATUS
approved