OFFSET
0,3
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 odd bisection (2,1,2), which is composition number 22 in standard order, hence a(741) = 22.
MATHEMATICA
Table[Total[2^Accumulate[Reverse[First/@Partition[Append[ Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse, 0], 2]]]]/2, {n, 0, 100}]
CROSSREFS
Length of the a(n)-th standard composition is A000120(n)/2 rounded up.
Positions of 1's are A003945.
Positions of 2's (and zero) are A083575.
Sum of the a(n)-th standard composition is A209281(n+1).
Positions of first appearances are A290259.
The version for prime indices is A346703.
A011782 counts compositions.
A029837 gives length of binary expansion.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A345197 counts compositions by sum, length, and alternating sum.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Aug 12 2021
STATUS
approved