login
A072575
Triangle T(n,k) of number of compositions (ordered partitions) of n into distinct parts where largest part is exactly k, 1<=k<=n.
8
1, 0, 1, 0, 2, 1, 0, 0, 2, 1, 0, 0, 2, 2, 1, 0, 0, 6, 2, 2, 1, 0, 0, 0, 8, 2, 2, 1, 0, 0, 0, 6, 8, 2, 2, 1, 0, 0, 0, 6, 8, 8, 2, 2, 1, 0, 0, 0, 24, 12, 8, 8, 2, 2, 1, 0, 0, 0, 0, 30, 14, 8, 8, 2, 2, 1, 0, 0, 0, 0, 30, 36, 14, 8, 8, 2, 2, 1, 0, 0, 0, 0, 24, 36, 38, 14, 8, 8, 2, 2, 1, 0, 0, 0, 0, 24, 54, 42, 38, 14, 8, 8, 2, 2, 1
OFFSET
1,5
EXAMPLE
Rows start:
1;
0, 1;
0, 2, 1;
0, 0, 2, 1;
0, 0, 2, 2, 1;
0, 0, 6, 2, 2, 1;
0, 0, 0, 8, 2, 2, 1;
0, 0, 0, 6, 8, 2, 2, 1;
...
T(7,4)=8 since 7 can be written as 4+3 =4+2+1 =4+1+2 =3+4 =2+4+1 =2+1+4 =1+4+2 =1+2+4.
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1,
`if`(i<1, [][], zip((x, y)->x+y, [b(n, i-1)],
`if`(i>n, [], [0, b(n-i, i-1)]), 0)[]))
end:
T:= proc(n, k) local l; l:= [b(n-k, k-1)];
add(l[i]*(i)!, i=1..nops(l))
end:
seq(seq(T(n, k), k=1..n), n=1..20); # Alois P. Heinz, Nov 20 2012
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, {1}, If[i<1, {}, Plus @@ PadRight[{b[n, i-1], If[i>n, {}, Join[{0}, b[n-i, i-1]]]}]]]; T[n_, k_] := Module[{l}, l = b[n-k, k-1]; Sum[l[[i]]*i!, {i, 1, Length[l]}]]; Table[Table [T[n, k], {k, 1, n}], {n, 1, 20}] // Flatten (* Jean-François Alcover, Jan 31 2014, after Alois P. Heinz *)
CROSSREFS
Cf. A026836, A072574. Row sums are A032020. Column sums appear to be A001339 (offset). Starting terms of columns tend towards A072576 as k increases.
Sequence in context: A226864 A257399 A168313 * A025872 A280125 A339060
KEYWORD
nonn,tabl
AUTHOR
Henry Bottomley, Jun 21 2002
STATUS
approved