A115981 The number of compositions of n which cannot be viewed as stacks.
0, 0, 0, 0, 0, 1, 5, 17, 49, 126, 303, 694, 1536, 3312, 7009, 14619, 30164, 61732, 125568, 254246, 513048, 1032696, 2074875, 4163256, 8345605, 16717996, 33473334, 66998380, 134067959, 268233386, 536599508, 1073378850, 2147000209
Offset: 0
Examples
a(5) = 1 counting {212}. a(6) = 5 counting {1212, 2112,2121,213,312}. a(7) = 17 counting {11212, 12112,12121, 21211, 21121, 21112, 2122, 2212, 2113, 3112, 2131, 3121, 1213, 1312, 412, 214, 313}. a(8) = 49 = 128 - 79. a(9) = 126 = 256 - 130.
Links
- Eric Weisstein's World of Mathematics, Unimodal Sequence
Crossrefs
The complement is counted by A001523.
The strict case is A072707.
The case covering an initial interval is A332743.
The version whose negation is not unimodal either is A332870.
Non-unimodal permutations are A059204.
Non-unimodal normal sequences are A328509.
Partitions with non-unimodal run-lengths are A332281.
Numbers whose prime signature is not unimodal are A332282.
Partitions whose 0-appended first differences are not unimodal are A332284.
Non-unimodal permutations of the prime indices of n are A332671.
Programs
-
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[#]&]],{n,0,10}] (* Gus Wiseman, Mar 05 2020 *)
Extensions
More terms from Brian Kuehn (brk158(AT)psu.edu), Apr 20 2006
a(25) corrected by Georg Fischer, Jun 29 2021
Comments