%I #7 Apr 10 2013 15:31:06
%S 1,1,1,2,2,1,4,5,3,2,9,14,9,6,4,21,42,28,19,13,9,51,132,90,62,43,30,
%T 21,127,429,297,207,145,102,72,51,323,1430,1001,704,497,352,250,178,
%U 127,835,4862,3432,2431,1727,1230,878,628,450,323,2188,16796,11934,8502
%N Triangle read by rows: counts ordered trees by number of edges and position of first edge that terminates at a vertex of outdegree 1.
%C 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.
%F 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.
%e Table begins
%e \ k 0, 1, 2, ...
%e n
%e 1 | 1
%e 2 | 1, 1
%e 3 | 2, 2, 1
%e 4 | 4, 5, 3, 2
%e 5 | 9, 14, 9, 6, 4
%e 6 | 21, 42, 28, 19, 13, 9
%e 7 | 51, 132, 90, 62, 43, 30, 21
%e 8 |127, 429, 297, 207, 145, 102, 72, 51
%e T(4,2)=3 counts the following ordered trees (drawn down from root).
%e ..|..../\..../|\..
%e ./.\....|.....|...
%e .|......|.........
%t 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}]]
%Y Column k=1 is A000108 (apart from first term), k=2 is A000245, k=3 is A026012.
%K nonn,tabl
%O 1,4
%A _David Callan_, Oct 24 2004