OFFSET
0,7
COMMENTS
A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.
A composition of n is a finite sequence of positive integers summing to n.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = 2^(n-1) - A001523(n) - A332578(n) + 2*A000041(n) - A000005(n) for n > 0. - Andrew Howroyd, Dec 30 2020
EXAMPLE
The a(6) = 2 and a(7) = 9 compositions:
(1212) (1213)
(2121) (1312)
(2131)
(3121)
(11212)
(12112)
(12121)
(21121)
(21211)
MATHEMATICA
unimodQ[q_]:=Or[Length[q]<=1, If[q[[1]]<=q[[2]], unimodQ[Rest[q]], OrderedQ[Reverse[q]]]]
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !unimodQ[#]&&!unimodQ[-#]&]], {n, 0, 10}]
CROSSREFS
The case of run-lengths of partitions is A332640.
The version for unsorted prime signature is A332643.
Unimodal compositions are A001523.
Non-unimodal compositions are A115981.
Non-unimodal normal sequences are A328509.
Compositions whose negation is unimodal are A332578.
Compositions whose negation is not unimodal are A332669.
Partitions with weakly increasing or decreasing run-lengths are A332745.
Compositions that are neither weakly increasing nor decreasing are A332834.
Compositions with weakly increasing or decreasing run-lengths are A332835.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 02 2020
EXTENSIONS
Terms a(21) and beyond from Andrew Howroyd, Dec 30 2020
STATUS
approved