login
Triangle of number of unimodal compositions of n into exactly k distinct terms.
7

%I #19 Mar 29 2020 16:29:53

%S 1,1,0,1,2,0,1,2,0,0,1,4,0,0,0,1,4,4,0,0,0,1,6,4,0,0,0,0,1,6,8,0,0,0,

%T 0,0,1,8,12,0,0,0,0,0,0,1,8,16,8,0,0,0,0,0,0,1,10,20,8,0,0,0,0,0,0,0,

%U 1,10,28,16,0,0,0,0,0,0,0,0,1,12,32,24,0,0,0,0,0,0,0,0,0,1,12,40,40,0,0,0,0,0,0,0,0,0,0

%N Triangle of number of unimodal compositions of n into exactly k distinct terms.

%C Also the number of compositions of n into exactly k distinct terms whose negation is unimodal. - _Gus Wiseman_, Mar 06 2020

%H Alois P. Heinz, <a href="/A072705/b072705.txt">Rows n = 1..141, flattened</a>

%F T(n,k) = 2^(k-1)*A060016(n,k) = T(n-k,k)+2*T(n-k,k-1) [starting with T(0,0)=0, T(0,1)=0 and T(n,1)=1 for n>0].

%e Rows start: 1; 1,0; 1,2,0; 1,2,0,0; 1,4,0,0,0; 1,4,4,0,0,0; 1,6,4,0,0,0,0; 1,6,8,0,0,0,0,0; etc. T(6,3)=4 since 6 can be written as 1+2+3, 1+3+2, 2+3+1, or 3+2+1 but not 2+1+3 or 3+1+2.

%e From _Gus Wiseman_, Mar 06 2020: (Start)

%e Triangle begins:

%e 1

%e 1 0

%e 1 2 0

%e 1 2 0 0

%e 1 4 0 0 0

%e 1 4 4 0 0 0

%e 1 6 4 0 0 0 0

%e 1 6 8 0 0 0 0 0

%e 1 8 12 0 0 0 0 0 0

%e 1 8 16 8 0 0 0 0 0 0

%e 1 10 20 8 0 0 0 0 0 0 0

%e 1 10 28 16 0 0 0 0 0 0 0 0

%e 1 12 32 24 0 0 0 0 0 0 0 0 0

%e 1 12 40 40 0 0 0 0 0 0 0 0 0 0

%e 1 14 48 48 16 0 0 0 0 0 0 0 0 0 0

%e (End)

%p b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, 1,

%p expand(b(n, i-1) +`if`(i>n, 0, x*b(n-i, i-1)))))

%p end:

%p T:= n-> (p-> seq(coeff(p, x, i)*ceil(2^(i-1)), i=1..n))(b(n$2)):

%p seq(T(n), n=1..14); # _Alois P. Heinz_, Mar 26 2014

%t b[n_, i_] := b[n, i] = If[n > i*(i+1)/2, 0, If[n == 0, 1, Expand[b[n, i-1] + If[i > n, 0, x*b[n-i, i-1]]]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i]* Ceiling[2^(i-1)], {i, 1, n}]][b[n, n]]; Table[T[n], {n, 1, 14}] // Flatten (* _Jean-François Alcover_, Feb 26 2015, after _Alois P. Heinz_ *)

%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,{k}],UnsameQ@@#&&unimodQ[#]&]],{n,12},{k,n}] (* _Gus Wiseman_, Mar 06 2020 *)

%Y Cf. A060016, A072574, A072704. Row sums are A072706.

%Y Column k = 2 is A052928.

%Y Unimodal compositions are A001523.

%Y Unimodal sequences covering an initial interval are A007052.

%Y Strict compositions are A032020.

%Y Non-unimodal strict compositions are A072707.

%Y Unimodal compositions covering an initial interval are A227038.

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

%Y Cf. A059204, A107429, A115981, A329398, A332285, A332286, A332578, A332870, A332874.

%K nonn,tabl,look

%O 1,5

%A _Henry Bottomley_, Jul 04 2002