OFFSET
0,5
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 negative is unimodal.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..200
FORMULA
EXAMPLE
The a(4) = 22 sequences:
(1,2,1,2) (2,3,1,3)
(1,2,1,3) (2,3,1,4)
(1,3,1,2) (2,4,1,3)
(1,3,2,3) (3,1,2,1)
(1,3,2,4) (3,1,3,2)
(1,4,2,3) (3,1,4,2)
(2,1,2,1) (3,2,3,1)
(2,1,3,1) (3,2,4,1)
(2,1,3,2) (3,4,1,2)
(2,1,4,3) (4,1,3,2)
(2,3,1,2) (4,2,3,1)
MATHEMATICA
allnorm[n_]:=If[n<=0, {{}}, Function[s, Array[Count[s, y_/; y<=#]+1&, n]]/@Subsets[Range[n-1]+1]];
unimodQ[q_]:=Or[Length[q]<=1, If[q[[1]]<=q[[2]], unimodQ[Rest[q]], OrderedQ[Reverse[q]]]];
Table[Length[Select[Union@@Permutations/@allnorm[n], !unimodQ[#]&&!unimodQ[-#]&]], {n, 0, 5}]
PROG
(PARI) seq(n)=Vec( serlaplace(1/(2-exp(x + O(x*x^n)))) - (1 - 6*x + 12*x^2 - 6*x^3)/((1 - x)*(1 - 2*x)*(1 - 4*x + 2*x^2)), -(n+1)) \\ Andrew Howroyd, Jan 28 2024
CROSSREFS
Not requiring non-co-unimodality gives A328509.
Not requiring non-unimodality also gives A328509.
The version for run-lengths of partitions is A332640.
The version for unsorted prime signature is A332643.
The version for compositions is A332870.
Unimodal compositions are A001523.
Unimodal sequences covering an initial interval are A007052.
Non-unimodal permutations are A059204.
Non-unimodal compositions are A115981.
Unimodal compositions covering an initial interval are A227038.
Numbers whose unsorted prime signature is not unimodal are A332282.
Numbers whose negated prime signature is not unimodal are A332642.
Compositions whose run-lengths are not unimodal are A332727.
Non-unimodal compositions covering an initial interval are A332743.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 03 2020
EXTENSIONS
a(9) onwards from Andrew Howroyd, Jan 28 2024
STATUS
approved