login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of compositions of n whose run-lengths are neither weakly increasing nor weakly decreasing.
21

%I #19 Jan 21 2024 11:07:14

%S 0,0,0,0,0,0,3,8,27,75,185,441,1025,2276,4985,10753,22863,48142,

%T 100583,208663,430563,884407,1809546,3690632,7506774,15233198,

%U 30851271,62377004,125934437,253936064,511491634,1029318958,2069728850,4158873540,8351730223,16762945432

%N Number of compositions of n whose run-lengths are neither weakly increasing nor weakly decreasing.

%C A composition of n is a finite sequence of positive integers summing to n.

%H Andrew Howroyd, <a href="/A332833/b332833.txt">Table of n, a(n) for n = 0..1000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/UnimodalSequence.html">Unimodal Sequence</a>.

%F a(n) = 2^(n - 1) - 2 * A332836(n) + A329738(n).

%e The a(6) = 3 and a(7) = 8 compositions:

%e (1221) (2113)

%e (2112) (3112)

%e (11211) (11311)

%e (12112)

%e (21112)

%e (21121)

%e (111211)

%e (112111)

%t Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!Or[LessEqual@@Length/@Split[#],GreaterEqual@@Length/@Split[#]]&]],{n,0,10}]

%Y The case of partitions is A332641.

%Y The version for unsorted prime signature is A332831.

%Y The version for the compositions themselves (not run-lengths) is A332834.

%Y The complement is counted by A332835.

%Y Unimodal compositions are A001523.

%Y Partitions with weakly increasing run-lengths are A100883.

%Y Compositions that are not unimodal are A115981.

%Y Compositions with equal run-lengths are A329738.

%Y Compositions whose run-lengths are unimodal are A332726.

%Y Compositions whose run-lengths are not unimodal are A332727.

%Y Partitions with weakly increasing or weakly decreasing run-lengths: A332745.

%Y Compositions with weakly increasing run-lengths are A332836.

%Y Compositions that are neither unimodal nor is their negation are A332870.

%Y Cf. A001462, A072704, A072706, A107429, A181819, A329398, A329744, A329746, A329766, A332273, A332640, A332746.

%K nonn

%O 0,7

%A _Gus Wiseman_, Feb 29 2020

%E Terms a(21) and beyond from _Andrew Howroyd_, Dec 30 2020