OFFSET
0,11
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. It is strict if there are not repeated parts.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Unimodal Sequence
FORMULA
G.f.: Sum_{k>=4} (k! - 2^k + 2) * [y^k](Product_{j>=1} 1 + y*x^j). - Andrew Howroyd, Apr 16 2021
EXAMPLE
The a(10) = 10 through a(12) = 20 compositions:
(1,3,2,4) (1,3,2,5) (1,3,2,6)
(1,4,2,3) (1,5,2,3) (1,4,2,5)
(2,1,4,3) (2,1,5,3) (1,5,2,4)
(2,3,1,4) (2,3,1,5) (1,6,2,3)
(2,4,1,3) (2,5,1,3) (2,1,5,4)
(3,1,4,2) (3,1,5,2) (2,1,6,3)
(3,2,4,1) (3,2,5,1) (2,3,1,6)
(3,4,1,2) (3,5,1,2) (2,4,1,5)
(4,1,3,2) (5,1,3,2) (2,5,1,4)
(4,2,3,1) (5,2,3,1) (2,6,1,3)
(3,1,6,2)
(3,2,6,1)
(3,6,1,2)
(4,1,5,2)
(4,2,5,1)
(4,5,1,2)
(5,1,4,2)
(5,2,4,1)
(6,1,3,2)
(6,2,3,1)
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], UnsameQ@@#&&!unimodQ[#]&&!unimodQ[-#]&]], {n, 0, 20}]
PROG
(PARI) seq(n)={my(p=prod(k=1, n, 1 + y*x^k + O(x*x^n))); Vec(sum(k=4, n, (k! - 2^k + 2)*polcoef(p, k, y)), -(n+1))} \\ Andrew Howroyd, Apr 16 2021
CROSSREFS
The non-strict version for unsorted prime signature is A332643.
The non-strict version is A332870.
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.
Compositions with neither weakly increasing nor weakly decreasing run-lengths are A332833.
Compositions with weakly increasing or weakly decreasing run-lengths are A332835.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 04 2020
EXTENSIONS
Terms a(21) and beyond from Andrew Howroyd, Apr 16 2021
STATUS
approved