OFFSET
0,15
LINKS
Alois P. Heinz, Rows n = 0..140, flattened
FORMULA
T(n,0) = 1, T(n,k) = 0 if k<0 or n<k, else T(n,k) = 3*C(n-1,3)*n^(n-4) if k=n, else T(n,k) = T(n-1,k) + Sum_{j=3..k-1} C(n-1,j) T(j+1,j+1) T(n-1-j,k-j-1).
EXAMPLE
T(5,4) = 15 = 5*3, because there are 5 possibilities for a single node and T(4,4) = 3:
.1-2. .1-2. .1.2.
.|.|. ..X.. .|X|.
.3-4. .3-4. .3.4.
Triangle begins:
1;
1, 0;
1, 0, 0;
1, 0, 0, 0;
1, 0, 0, 0, 3;
1, 0, 0, 0, 15, 60;
MAPLE
T:= proc(n, k) option remember; if k=0 then 1 elif k<0 or n<k then 0 elif k=n then 3*binomial(n-1, 3)*n^(n-4) else T(n-1, k) +add(binomial(n-1, j) * T(j+1, j+1) *T(n-1-j, k-j-1), j=3..k-1) fi end: seq(seq(T(n, k), k=0..n), n=0..11);
MATHEMATICA
T[n_, k_] := T[n, k] = Which[k == 0, 1, k < 0 || n < k, 0, k == n, 3*Binomial[n-1, 3]*n^(n-4), True, T[n-1, k] + Sum[Binomial[n-1, j]*T[j+1, j+1]*T[n-1-j, k-j-1], {j, 3, k-1}]]; Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Aug 29 2014, translated from Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Sep 14 2008
STATUS
approved