OFFSET
0,4
COMMENTS
Here we're using the conventional definition of BST height, which is path length from the root to the node (the height of an empty tree is -1), as compared to A195582 which has the height one greater.
FORMULA
MAPLE
b:= proc(n, k) option remember;
if n=0 then 1
elif n=1 then `if`(k>0, 1, 0)
else add(binomial(n-1, r-1) *b(r-1, k-1) *b(n-r, k-1), r=1..n)
fi
end:
T:= (n, k)-> b(n, k)-`if`(k>0, b(n, k-1), 0):
a:= n-> add(T(n, k)*k, k=0..n)/n!:
seq(numer(a(n)-1), n=0..30);
MATHEMATICA
[n_, k_] := b[n, k] = If[n==0, 1, If[n==1, If[k>0, 1, 0], Sum[Binomial[n - 1, r-1]*b[r-1, k-1]*b[n-r, k-1], {r, 1, n}]]]; T[n_, k_] := b[n, k] - If[ k>0, b[n, k-1], 0]; a[n_] := Sum[T[n, k]*k, {k, 0, n}]/n!; Table[ Numerator[a[n]-1], {n, 0, 30}]
CROSSREFS
KEYWORD
sign,frac
AUTHOR
Melissa O'Neill, Jul 20 2024
STATUS
approved