A350356 Numbers k such that the k-th composition in standard order is down/up.
0, 1, 2, 4, 5, 8, 9, 16, 17, 18, 22, 32, 33, 34, 38, 44, 45, 64, 65, 66, 68, 70, 76, 77, 88, 89, 128, 129, 130, 132, 134, 140, 141, 148, 152, 153, 176, 177, 178, 182, 256, 257, 258, 260, 262, 264, 268, 269, 276, 280, 281, 296, 297, 304, 305, 306, 310, 352, 353
Offset: 1
Keywords
Examples
The terms together with the corresponding compositions begin: 0: () 1: (1) 2: (2) 4: (3) 5: (2,1) 8: (4) 9: (3,1) 16: (5) 17: (4,1) 18: (3,2) 22: (2,1,2) 32: (6) 33: (5,1) 34: (4,2) 38: (3,1,2) 44: (2,1,3) 45: (2,1,2,1)
Links
- Gus Wiseman, Statistics, classes, and transformations of standard compositions
- Wikipedia, Alternating permutation
Crossrefs
The case of permutations is counted by A000111.
Counting patterns of this type gives A350354.
The up/down version is A350355.
A003242 counts anti-run compositions.
A349057 ranks non-weakly alternating compositions.
Statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of maximal anti-runs is A333381.
- Number of distinct parts is A334028.
Classes of standard compositions:
- Strict compositions are A233564.
- Constant compositions are A272919.
- Patterns are A333217.
Programs
-
Mathematica
doupQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]
y[[m+1]]],{m,1,Length[y]-1}]; stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Select[Range[0,100],doupQ[stc[#]]&]
Comments