|
|
A124767
|
|
Number of level runs for compositions in standard order.
|
|
129
|
|
|
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, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 4, 3, 2, 2, 3, 3, 3, 2, 2, 3, 2, 3, 4, 3, 4, 3, 4, 3, 2, 2, 3, 3, 3, 2, 4, 4, 3, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
LINKS
|
|
|
FORMULA
|
a(0) = 0, a(n) = 1 + Sum_{1<=i=1<k, b(i)!=b(i+1)} 1 for n > 0.
|
|
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
|
All of the following pertain to compositions in standard order (A066099):
- 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.
- Constant compositions are A272919.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-run compositions are A333489.
- Run-lengths are A333769 (triangle).
|
|
KEYWORD
|
easy,nonn,tabf
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|