OFFSET
0,3
COMMENTS
Empty external nodes are counted in determining the height of a search tree.
LINKS
EXAMPLE
Triangle T(n,k) begins:
: 1;
: 1;
: 2;
: 2, 4;
: 16, 8;
: 40, 64, 16;
: 80, 400, 208, 32;
: 80, 2240, 2048, 608, 64;
: 11360, 18816, 8352, 1664, 128;
: 55040, 168768, 104448, 30016, 4352, 256;
: 253440, 1508032, 1277568, 479040, 99200, 11008, 512;
MAPLE
b:= proc(n, k) option remember; `if`(n<2, `if`(k<n, 0, 1),
add(binomial(n-1, r)*b(r, k-1)*b(n-1-r, k-1), r=0..n-1))
end:
T:= (n, k)-> b(n, k)-b(n, k-1):
seq(seq(T(n, k), n=k..2^k-1), k=0..5);
MATHEMATICA
b[n_, k_] := b[n, k] = If[n<2, If[k<n, 0, 1], Sum[Binomial[n-1, r]*b[r, k-1]*b[n-1-r, k-1], {r, 0, n-1}]]; T[n_, k_] := b[n, k] - b[n, k-1]; Table[T[n, k], {k, 0, 5}, {n, k, 2^k-1}] // Flatten (* Jean-François Alcover, Feb 19 2017, translated from Maple *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Alois P. Heinz, Dec 21 2015
STATUS
approved