OFFSET
1,1
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
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.
LINKS
Eric Weisstein's World of Mathematics, Unimodal Sequence
EXAMPLE
The sequence together with the corresponding triples begins:
7: (1,1,1) 52: (1,2,3) 133: (5,2,1)
11: (2,1,1) 56: (1,1,4) 137: (4,3,1)
13: (1,2,1) 67: (5,1,1) 138: (4,2,2)
14: (1,1,2) 69: (4,2,1) 145: (3,4,1)
19: (3,1,1) 73: (3,3,1) 146: (3,3,2)
21: (2,2,1) 74: (3,2,2) 161: (2,5,1)
25: (1,3,1) 81: (2,4,1) 162: (2,4,2)
26: (1,2,2) 82: (2,3,2) 164: (2,3,3)
28: (1,1,3) 84: (2,2,3) 168: (2,2,4)
35: (4,1,1) 97: (1,5,1) 193: (1,6,1)
37: (3,2,1) 98: (1,4,2) 194: (1,5,2)
41: (2,3,1) 100: (1,3,3) 196: (1,4,3)
42: (2,2,2) 104: (1,2,4) 200: (1,3,4)
49: (1,4,1) 112: (1,1,5) 208: (1,2,5)
50: (1,3,2) 131: (6,1,1) 224: (1,1,6)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 1000], Length[stc[#]]==3&&!MatchQ[stc[#], {x_, y_, z_}/; x>y<z]&]
CROSSREFS
A337460 is the non-unimodal version.
A000217(n - 2) counts 3-part compositions.
A001523 counts unimodal compositions.
A007052 counts unimodal patterns.
A011782 counts unimodal permutations.
A115981 counts non-unimodal compositions.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Heinz number is A333219.
- Combinatory separations are counted by A334030.
- Non-unimodal compositions are A335373.
- Non-co-unimodal compositions are A335374.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 07 2020
STATUS
approved