OFFSET
1,1
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.
These are also numbers k such that the maximal weakly increasing runs in the reverse of the k-th composition in standard order do not have weakly decreasing leaders, where the leaders of weakly increasing runs in a sequence are obtained by splitting it into maximal weakly increasing subsequences and taking the first term of each.
The reverse version (A375137) ranks compositions matching the dashed pattern 1-32.
LINKS
Wikipedia, Permutation pattern.
EXAMPLE
Composition 89 is (2,1,3,1), which matches 2-3-1 but not 23-1.
Composition 165 is (2,3,2,1), which matches 23-1 but not 231.
Composition 358 is (2,1,3,1,2), which matches 2-3-1 and 1-3-2 but not 23-1 or 1-32.
The sequence together with corresponding compositions begins:
41: (2,3,1)
81: (2,4,1)
83: (2,3,1,1)
105: (1,2,3,1)
145: (3,4,1)
161: (2,5,1)
163: (2,4,1,1)
165: (2,3,2,1)
166: (2,3,1,2)
167: (2,3,1,1,1)
169: (2,2,3,1)
209: (1,2,4,1)
211: (1,2,3,1,1)
233: (1,1,2,3,1)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 100], MatchQ[stc[#], {___, y_, z_, ___, x_, ___}/; x<y<z]&] (*23-1*)
CROSSREFS
The complement is too dense, but counted by A189076.
Compositions of this type are counted by A374636.
A011782 counts compositions.
All of the following pertain to compositions in standard order:
- Length is A000120.
- Sum is A029837(n+1).
- Leader is A065120.
- Strict compositions are A233564.
- Constant compositions are A272919.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Aug 09 2024
STATUS
approved