OFFSET
0,6
COMMENTS
The standard order of compositions is given by A066099.
For n > 0, a(n) is one more than the number of adjacent unequal terms in the n-th composition in standard order. Also the number of runs in the same composition. - Gus Wiseman, Apr 08 2020
FORMULA
a(0) = 0, a(n) = 1 + Sum_{1<=i=1<k, b(i)!=b(i+1)} 1 for n > 0.
For n > 0, a(n) = A333382(n) + 1. - Gus Wiseman, Apr 08 2020
EXAMPLE
Composition number 11 is 2,1,1; the level runs are 2; 1,1; so a(11) = 2.
The table starts:
0
1
1 1
1 2 2 1
1 2 1 2 2 3 2 1
1 2 2 2 2 2 3 2 2 3 2 3 2 3 2 1
1 2 2 2 1 3 3 2 2 3 1 2 3 4 3 2 2 3 3 3 3 3 4 3 2 3 2 3 2 3 2 1
The 1234567th composition in standard order is (3,2,1,2,2,1,2,5,1,1,1) with runs ((3),(2),(1),(2,2),(1),(2),(5),(1,1,1)), so a(1234567) = 8. - Gus Wiseman, Apr 08 2020
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[Length[Split[stc[n]]], {n, 0, 100}] (* Gus Wiseman, Apr 17 2020 *)
CROSSREFS
Row-lengths are A011782.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767 (this sequence).
- Weakly increasing compositions are A225620.
- Strict compositions A233564.
- Constant compositions are A272919.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-run compositions are A333489.
- Runs-resistance is A333628.
- Run-lengths are A333769 (triangle).
KEYWORD
easy,nonn,tabf
AUTHOR
Franklin T. Adams-Watters, Nov 06 2006
STATUS
approved