Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Jan 29 2016 10:23:13
%S 1,1,1,5,4,1,33,25,7,1,249,184,54,10,1,2033,1481,446,92,13,1,17485,
%T 12620,3863,846,139,16,1,156033,111889,34637,7881,1411,195,19,1,
%U 1431281,1021424,318812,74492,14102,2168,260,22,1,13412193,9536113,2995228
%N Triangle read by rows: T(n,k) is number of paths from (0,0) to (3n,0) that stay in the first quadrant (but may touch the horizontal axis), consisting of steps u=(2,1), U=(1,2), or d=(1,-1) and having k u=(2,1) steps among the steps leading to the first d step.
%H Alois P. Heinz, <a href="/A108440/b108440.txt">Rows n = 0..140, flattened</a>
%H Emeric Deutsch, <a href="http://www.jstor.org/stable/2589192">Problem 10658: Another Type of Lattice Path</a>, American Math. Monthly, 107, 2000, 368-370.
%F G.f.: G(t, z)=1/(1-tzA-zA^2)-1, where A=1+zA^2+zA^3=(2/3)*sqrt((z+3)/z)*sin((1/3)*arcsin(sqrt(z)*(z+18)/(z+3)^(3/2)))-1/3 (the g.f. of A027307).
%e T(2,1)=4 because we have udud, udUdd, uUddd and Uuddd.
%e Triangle begins:
%e .1;
%e .1,1;
%e .5,4,1;
%e .33,25,7,1;
%e .249,184,54,10,1;
%p A:=(2/3)*sqrt((z+3)/z)*sin((1/3)*arcsin(sqrt(z)*(z+18)/(z+3)^(3/2)))-1/3: G:=1/(1-t*z*A-z*A^2): Gser:=simplify(series(G,z=0,12)): P[0]:=1: for n from 1 to 9 do P[n]:=coeff(Gser,z^n) od: for n from 0 to 9 do seq(coeff(t*P[n],t^k),k=1..n+1) od; # yields sequence in triangular form
%p # second Maple program:
%p b:= proc(x, y, t) option remember; expand(`if`(y<0 or y>x, 0,
%p `if`(x=0, 1, b(x-1, y-1, false)+b(x-1, y+2, t)+
%p b(x-2, y+1, t)*`if`(t, z, 1))))
%p end:
%p T:= n-> (p-> seq(coeff(p, z, i), i=0..n))(b(3*n, 0, true)):
%p seq(T(n), n=0..10); # _Alois P. Heinz_, Oct 06 2015
%t b[x_, y_, t_] := b[x, y, t] = Expand[If[y < 0 || y > x, 0, If[x == 0, 1, b[x - 1, y - 1, False] + b[x - 1, y + 2, t] + b[x - 2, y + 1, t]*If[t, z, 1]]]]; T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 0, n}]][ b[3*n, 0, True]]; Table[T[n], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, Jan 29 2016, after _Alois P. Heinz_ *)
%Y Row sums yield A027307. Column 0 yields A034015.
%Y Cf. A027307, A034015, A108441.
%K nonn,tabl
%O 0,4
%A _Emeric Deutsch_, Jun 08 2005