OFFSET
1,1
COMMENTS
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either.
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.
EXAMPLE
The terms and corresponding permutations begin:
37: (3,2,1)
52: (1,2,3)
549: (4,3,2,1)
550: (4,3,1,2)
556: (4,2,1,3)
564: (4,1,2,3)
581: (3,4,2,1)
600: (3,2,1,4)
616: (3,1,2,4)
649: (2,4,3,1)
657: (2,3,4,1)
712: (2,1,3,4)
786: (1,4,3,2)
802: (1,3,4,2)
836: (1,2,4,3)
840: (1,2,3,4)
16933: (5,4,3,2,1)
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, 1000], (Sort[stc[#]]==Range[Length[stc[#]]]&&!wigQ[stc[#]])&]
CROSSREFS
This is the non-alternating case of A333218.
A345192 counts non-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.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 13 2022
STATUS
approved