OFFSET
0,3
COMMENTS
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 maximal weakly decreasing subsequences of the 1234567th composition in standard order are ((3,2,1),(2,2,1),(2),(5,1,1,1)), so a(1234567) is 3+2+2+5 = 12.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[Total[First/@Split[stc[n], GreaterEqual]], {n, 0, 100}]
CROSSREFS
For length instead of sum we have A124765.
The opposite is A374630.
A373949 counts compositions by run-compressed sum.
All of the following pertain to compositions in standard order:
- Length is A000120.
- Parts are listed by A066099.
- Constant compositions are ranked by A272919.
- Run-length transform is A333627.
- Run-compression transform is A373948.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jul 24 2024
STATUS
approved