OFFSET
0,3
COMMENTS
The a(n)-th composition in standard order lists the leaders of weakly decreasing runs in the n-th composition in standard order.
The leaders of weakly decreasing runs in a sequence are obtained by splitting it into maximal weakly decreasing subsequences and taking the first term of each.
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
EXAMPLE
The 813th composition in standard order is (1,3,2,1,2,1), with weakly decreasing runs ((1),(3,2,1),(2,1)), with leaders (1,3,2). This is the 50th composition in standard order, so a(813) = 50.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
Table[stcinv[First/@Split[stc[n], GreaterEqual]], {n, 0, 100}]
CROSSREFS
Ranks of rows of A374740.
The opposite version is A375123.
The strict version is A375126.
The strict opposite version is A375125.
A011782 counts compositions.
All of the following pertain to compositions in standard order:
- Length is A000120.
- Parts are listed by A066099.
- Run-sum transformation is A353847.
Six types of runs:
KEYWORD
nonn
AUTHOR
Gus Wiseman, Aug 02 2024
STATUS
approved