OFFSET
0,3
COMMENTS
The leaders of weakly increasing runs in a sequence are obtained by splitting it into maximal weakly increasing 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 increasing subsequences of the 1234567th composition in standard order are ((3),(2),(1,2,2),(1,2,5),(1,1,1)), so a(1234567) = 8.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[Total[First/@Split[stc[n], LessEqual]], {n, 0, 100}]
CROSSREFS
For length instead of sum we have A124766.
For leaders of anti-runs we have A374516.
Row-sums of A374629.
Counting compositions by this statistic gives A374637.
For leaders of strictly increasing runs we have A374684.
For leaders of weakly decreasing runs we have A374741.
For leaders of strictly decreasing runs we have A374758
A011782 counts compositions.
A335456 counts patterns matched by compositions.
All of the following pertain to compositions in standard order:
- Ones are counted by A000120.
- Listed by A066099.
- Length is A070939.
- Constant compositions are ranked by A272919.
- Run-length transform is A333627.
- Run-compression transform is A373948.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jul 20 2024
STATUS
approved