%I #6 Sep 09 2023 22:28:07
%S 1,1,1,1,1,3,1,7,1,1,15,5,1,32,17,1,1,70,49,7,1,159,131,31,1,1,375,
%T 339,111,9,1,914,869,354,49,1,1,2288,2233,1056,209,11,1,5850,5784,
%U 3031,773,71,1,1,15210,15132,8515,2613,351,13,1,40081,39990,23659,8329,1476,97,1
%N Triangle read by rows: T(n,k) is the number of Motzkin paths of length n having k returns (i.e., down steps hitting the x-axis).
%C Row sums are the Motzkin numbers (A001006).
%F G.f. = 2/(2 - 2*z - t + t*z + t*sqrt(1 - 2*z - 3*z^2)).
%e Triangle begins:
%e 1;
%e 1;
%e 1, 1;
%e 1, 3;
%e 1, 7, 1;
%e 1, 15, 5;
%e Row n has 1+floor(n/2) terms.
%e T(5,2)=5 because HU(D)U(D), U(D)HU(D), U(D)U(D)H, U(D)UH(D) and UH(D)U(D) are the only Motzkin paths of length 5 with 2 returns (shown between parentheses); here U=(1,1), H=(1,0) and D=(1,-1).
%p G:= 2/(2-2*z-t+t*z+t*sqrt(1-2*z-3*z^2)) : Gser:=simplify(series(G,z=0,16)): P[0]:=1: for n from 1 to 15 do P[n]:=sort(coeff(Gser,z^n)) od: seq(seq(coeff(t*P[n],t^k),k=1..1+floor(n/2)),n=0..15);
%Y Cf. A001006.
%K nonn,tabf
%O 0,6
%A _Emeric Deutsch_, Aug 30 2004