login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A332726 Number of compositions of n whose run-lengths are unimodal. 18

%I #17 Jan 21 2024 11:06:52

%S 1,1,2,4,8,16,31,61,120,228,438,836,1580,2976,5596,10440,19444,36099,

%T 66784,123215,226846,416502,763255,1395952,2548444,4644578,8452200,

%U 15358445,27871024,50514295,91446810,165365589,298730375,539127705,972099072,1751284617,3152475368

%N Number of compositions of n whose run-lengths are unimodal.

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

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

%H Andrew Howroyd, <a href="/A332726/b332726.txt">Table of n, a(n) for n = 0..500</a>

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

%F a(n) + A332727(n) = 2^(n - 1).

%e The only composition of 6 whose run-lengths are not unimodal is (1,1,2,1,1).

%t unimodQ[q_]:=Or[Length[q]<=1,If[q[[1]]<=q[[2]],unimodQ[Rest[q]],OrderedQ[Reverse[q]]]]

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

%o (PARI)

%o step(M, m)={my(n=matsize(M)[1]); for(p=m+1, n, my(v=vector((p-1)\m, i, M[p-i*m,i]), s=vecsum(v)); M[p,]+=vector(#M,i,s-if(i<=#v, v[i]))); M}

%o desc(M, m)={my(n=matsize(M)[1]); while(m>1, m--; M=step(M,m)); vector(n, i, vecsum(M[i,]))/(#M-1)}

%o seq(n)={my(M=matrix(n+1, n+1, i, j, i==1), S=M[,1]~); for(m=1, n, my(D=M); M=step(M, m); D=(M-D)[m+1..n+1,1..n-m+2]; S+=concat(vector(m), desc(D,m))); S} \\ _Andrew Howroyd_, Dec 31 2020

%Y Looking at the composition itself (not run-lengths) gives A001523.

%Y The case of partitions is A332280, with complement counted by A332281.

%Y The complement is counted by A332727.

%Y Unimodal compositions are A001523.

%Y Unimodal normal sequences appear to be A007052.

%Y Non-unimodal compositions are A115981.

%Y Compositions with normal run-lengths are A329766.

%Y Numbers whose prime signature is not unimodal are A332282.

%Y Partitions whose 0-appended first differences are unimodal are A332283, with complement A332284, with Heinz numbers A332287.

%Y Compositions whose negated run-lengths are unimodal are A332578.

%Y Compositions whose negated run-lengths are not unimodal are A332669.

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

%Y Cf. A072706, A100883, A181819, A227038, A328509, A329744, A329746, A332642, A332670, A332741, A332833, A332835.

%K nonn

%O 0,3

%A _Gus Wiseman_, Feb 29 2020

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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)