

A328509


Number of nonunimodal sequences of length n covering an initial interval of positive integers.


45




OFFSET

0,4


COMMENTS

A sequence of integers is unimodal if it is the concatenation of a weakly increasing and a weakly decreasing sequence.


LINKS

Table of n, a(n) for n=0..9.
MathWorld, Unimodal Sequence


EXAMPLE

The a(3) = 3 sequences are (2,1,2), (2,1,3), (3,1,2).
The a(4) = 41 sequences:
(1212) (2113) (2134) (2413) (3142) (3412)
(1213) (2121) (2143) (3112) (3212) (4123)
(1312) (2122) (2212) (3121) (3213) (4132)
(1323) (2123) (2213) (3122) (3214) (4213)
(1324) (2131) (2312) (3123) (3231) (4231)
(1423) (2132) (2313) (3124) (3241) (4312)
(2112) (2133) (2314) (3132) (3312)


MATHEMATICA

allnorm[n_]:=If[n<=0, {{}}, Function[s, Array[Count[s, y_/; y<=#]+1&, n]]/@Subsets[Range[n1]+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[#]&]], {n, 0, 5}]


CROSSREFS

Not requiring nonunimodality gives A000670.
The complement appears to be counted by A007052.
The case where the negation is not unimodal either is A332873.
Unimodal compositions are A001523.
Nonunimodal permutations are A059204.
Nonunimodal compositions are A115981.
Unimodal compositions covering an initial interval are A227038.
Numbers whose unsorted prime signature is not unimodal are A332282.
Covering partitions with unimodal runlengths are A332577.
Nonunimodal compositions covering an initial interval are A332743.
Cf. A060223, A255906, A332281, A332284, A332639, A332672, A332834, A332870.
Sequence in context: A322244 A181226 A159249 * A087544 A305667 A213378
Adjacent sequences: A328506 A328507 A328508 * A328510 A328511 A328512


KEYWORD

nonn,more


AUTHOR

Gus Wiseman, Feb 19 2020


EXTENSIONS

a(9) from Robert Price, Jun 19 2021


STATUS

approved



