A109195 Triangle read by rows: T(n,k) is number of Grand Motzkin paths of length n having k returns to the x-axis from above (i.e., d steps hitting the x-axis).
1, 1, 2, 1, 4, 3, 9, 9, 1, 21, 25, 5, 51, 69, 20, 1, 127, 189, 70, 7, 323, 518, 230, 35, 1, 835, 1422, 726, 147, 9, 2188, 3915, 2235, 560, 54, 1, 5798, 10813, 6765, 2002, 264, 11, 15511, 29964, 20240, 6853, 1143, 77, 1, 41835, 83304, 60060, 22737, 4563, 429, 13
Offset: 0
Examples
T(3,1)=3 because we have hud, udh and uhd, where u=(1,1),d=(1,-1), h=(1,0). Triangle begins: 1; 1; 2, 1; 4, 3; 9, 9, 1; 21, 25, 5; 51, 69, 20, 1;
Programs
-
Maple
M:=(1-z-sqrt(1-2*z-3*z^2))/2/z^2: G:=1/(1-z-(1+t)*z^2*M): Gser:=simplify(series(G,z=0,17)): P[0]:=1: for n from 1 to 14 do P[n]:=coeff(Gser,z^n) od: for n from 0 to 14 do seq(coeff(t*P[n],t^k),k=1..1+floor(n/2)) od; # yields sequence in triangular form
Comments