OFFSET
1,4
COMMENTS
T(n,k) = number of ordered trees on n edges whose k-th edge (in preorder or "walk around from root" order) is the first one that terminates at a vertex of outdegree 1 (k=0 if there is no such edge). The first column and the main diagonal (after initial entry) are Motzkin numbers (A001006). Each interior entry is the sum of its North and East neighbors.
FORMULA
G.f. for column k=0 is (1 - z - (1-2*z-3*z^2)^(1/2))/(2*z^2) = Sum_{n>=1}T(n, 0)z^n. G.f. for columns k>=1 is (t*(1 - (1 - 4*z)^(1/2) - 2*z))/ (1 - t + t*(1 - 4*z)^(1/2) + t*z + (1 - 2*t*z - 3*t^2*z^2)^(1/2)) = Sum_{n>=2, 1<=k<=n-1}T(n, k)z^n*t^k.
EXAMPLE
Table begins
\ k 0, 1, 2, ...
n
1 | 1
2 | 1, 1
3 | 2, 2, 1
4 | 4, 5, 3, 2
5 | 9, 14, 9, 6, 4
6 | 21, 42, 28, 19, 13, 9
7 | 51, 132, 90, 62, 43, 30, 21
8 |127, 429, 297, 207, 145, 102, 72, 51
T(4,2)=3 counts the following ordered trees (drawn down from root).
..|..../\..../|\..
./.\....|.....|...
.|......|.........
MATHEMATICA
Clear[v] MotzkinNumber[n_]/; IntegerQ[n] && n>=0 := If[0<=n<=1, 1, Module[{x = 1, y = 1}, Do[temp = ((2*i + 1)*y + 3*(i - 1)*x)/(i + 2); x = y; y = temp, {i, 2, n}]; y]]; v[n_, 0]/; n>=1 := MotzkinNumber[n-1]; v[n_, k_]/; k>=n := 0; v[n_, k_]/; n>=2 && k==n-1 := MotzkinNumber[n-2]; v[n_, k_]/; n>=3 && 1<=k<=n-2 := v[n, k] = v[n, k+1]+v[n-1, k]; TableForm[Table[v[n, k], {n, 10}, {k, 0, n-1}]]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
David Callan, Oct 24 2004
STATUS
approved