OFFSET
1,5
LINKS
Alois P. Heinz, Rows n = 1..150, flattened
EXAMPLE
T(7,0) = 1: [7].
T(7,1) = 4: [4,3], [3,4], [2,3,2], [1,2,1,2,1].
T(7,2) = 7: [3,1,3], [3,1,2,1], [2,1,3,1], [1,3,2,1], [1,3,1,2], [1,2,3,1], [1,2,1,3].
T(7,3) = 8: [5,2], [4,2,1], [4,1,2], [2,5], [2,4,1], [2,1,4], [1,4,2], [1,2,4].
T(7,4) = 1: [1,5,1].
T(7,5) = 2: [6,1], [1,6].
Triangle T(n,k) begins:
1;
1, 0;
1, 2, 0;
1, 1, 2, 0;
1, 3, 1, 2, 0;
1, 2, 8, 1, 2, 0;
1, 4, 7, 8, 1, 2, 0;
1, 2, 13, 12, 8, 1, 2, 0;
MAPLE
b:= proc(n, k, s, t, l) option remember;
`if`(n<0, 0, `if`(n=0, 1, add(`if`(j=l, 0, b(n-j, k,
min(s, j), max(t, j), j)), j=max(1, t-k+1)..s+k-1)))
end:
A:= proc(n, k) option remember;
`if`(n=0, 1, add(b(n-j, k+1, j, j, j), j=1..n))
end:
T:= (n, k)-> A(n, k) -`if`(k=0, 0, A(n, k-1)):
seq(seq(T(n, k), k=0..n-1), n=1..14);
MATHEMATICA
b[n_, k_, s_, t_, l_] := b[n, k, s, t, l] = If[n < 0, 0, If[n == 0, 1, Sum [If[j == l, 0, b[n-j, k, Min[s, j], Max[t, j], j]], {j, Max[1, t-k+1], s+k-1}] ] ]; a[n_, k_] := a[n, k] = If[n == 0, 1, Sum[b[n - j, k+1, j, j, j], {j, 1, n}]]; t[n_, k_] := a[n, k] - If[k == 0, 0, a[n, k-1]]; Table[Table[t[n, k], {k, 0, n-1}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Dec 11 2013, translated from Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Jul 09 2012
STATUS
approved