OFFSET
1,1
COMMENTS
A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence. It is co-unimodal if its negation is unimodal.
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 sequence together with the corresponding compositions begins:
45: (2,1,2,1)
54: (1,2,1,2)
77: (3,1,2,1)
89: (2,1,3,1)
91: (2,1,2,1,1)
93: (2,1,1,2,1)
102: (1,3,1,2)
108: (1,2,1,3)
109: (1,2,1,2,1)
110: (1,2,1,1,2)
118: (1,1,2,1,2)
141: (4,1,2,1)
153: (3,1,3,1)
155: (3,1,2,1,1)
157: (3,1,1,2,1)
166: (2,3,1,2)
173: (2,2,1,2,1)
177: (2,1,4,1)
178: (2,1,3,2)
179: (2,1,3,1,1)
MATHEMATICA
unimodQ[q_]:=Or[Length[q]<=1, If[q[[1]]<=q[[2]], unimodQ[Rest[q]], OrderedQ[Reverse[q]]]];
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 100], !unimodQ[stc[#]]&&!unimodQ[-stc[#]]&]
CROSSREFS
Non-unimodal compositions are ranked by A335373.
Non-co-unimodal compositions are ranked by A335374.
Unimodal compositions are A001523.
Unimodal normal sequences are A007052.
Unimodal permutations are A011782.
Non-unimodal permutations are A059204.
Non-unimodal compositions are A115981.
Non-unimodal normal sequences are A328509.
Numbers with non-unimodal unsorted prime signature are A332282.
Co-unimodal compositions are A332578.
Numbers with non-co-unimodal unsorted prime signature are A332642.
Non-co-unimodal compositions are A332669.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 04 2020
STATUS
approved