login
A345167
Numbers k such that the k-th composition in standard order is alternating.
75
0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 16, 17, 18, 20, 22, 24, 25, 32, 33, 34, 38, 40, 41, 44, 45, 48, 49, 50, 54, 64, 65, 66, 68, 70, 72, 76, 77, 80, 81, 82, 88, 89, 96, 97, 98, 102, 108, 109, 128, 129, 130, 132, 134, 140, 141, 144, 145, 148, 152, 153, 160, 161, 162
OFFSET
1,3
COMMENTS
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.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
EXAMPLE
The terms together with their binary indices begin:
1: (1) 25: (1,3,1) 66: (5,2)
2: (2) 32: (6) 68: (4,3)
4: (3) 33: (5,1) 70: (4,1,2)
5: (2,1) 34: (4,2) 72: (3,4)
6: (1,2) 38: (3,1,2) 76: (3,1,3)
8: (4) 40: (2,4) 77: (3,1,2,1)
9: (3,1) 41: (2,3,1) 80: (2,5)
12: (1,3) 44: (2,1,3) 81: (2,4,1)
13: (1,2,1) 45: (2,1,2,1) 82: (2,3,2)
16: (5) 48: (1,5) 88: (2,1,4)
17: (4,1) 49: (1,4,1) 89: (2,1,3,1)
18: (3,2) 50: (1,3,2) 96: (1,6)
20: (2,3) 54: (1,2,1,2) 97: (1,5,1)
22: (2,1,2) 64: (7) 98: (1,4,2)
24: (1,4) 65: (6,1) 102: (1,3,1,2)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
wigQ[y_]:=Or[Length[y]==0, Length[Split[y]] ==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Select[Range[0, 100], wigQ@*stc]
CROSSREFS
These compositions are counted by A025047, complement A345192.
The complement is A345168.
Partitions with a permutation of this type: A345170, complement A345165.
Factorizations with a permutation of this type: A348379.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions.
A345164 counts alternating permutations of prime indices.
A345194 counts alternating patterns, with twins A344605.
Statistics of standard compositions:
- Length is A000120.
- Constant runs are A124767.
- Heinz number is A333219.
- Number of maximal anti-runs is A333381.
- Runs-resistance is A333628.
- Number of distinct parts is A334028.
Classes of standard compositions:
- Weakly decreasing compositions (partitions) are A114994.
- Weakly increasing compositions (multisets) are A225620.
- Anti-runs are A333489.
- Non-alternating anti-runs are A345169.
Sequence in context: A188080 A048262 A333489 * A370607 A285035 A374698
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 15 2021
STATUS
approved