%I #10 Jan 29 2016 09:33:55
%S 1,0,1,0,1,1,1,1,2,1,4,3,3,3,1,13,11,7,6,4,1,42,37,23,14,10,5,1,139,
%T 122,78,43,25,15,6,1,470,408,262,145,75,41,21,7,1,1616,1390,887,494,
%U 251,124,63,28,8,1,5632,4810,3048,1694,864,414,196,92,36,9,1,19852,16857,10622
%N Triangle read by rows: T(n,k) is the number of Dyck paths of semilength n having k pyramids.
%C A pyramid in a Dyck path is a factor of the form U^j D^j (j>0), starting at the x-axis. Here U=(1,1) and D(1,-1). This definition differs from the one in A091866. Column k=0 is A082989. Row sums are the Catalan numbers (A000108).
%H Alois P. Heinz, <a href="/A094322/b094322.txt">Rows n = 0..140, flattened</a>
%F G.f.: G=G(t,z) = (1-z)/(1-zC+z^2*C -tz), where C = [1-sqrt(1-4z)]/(2z) is the Catalan function.
%e T(3,2)=2 because there are two Dyck paths of semilength 3 having 2 pyramids: (UD)(UUDD) and (UUDD)(UD) (pyramids shown between parentheses).
%e Triangle begins:
%e [1];
%e [0, 1];
%e [0, 1, 1];
%e [1, 1, 2, 1];
%e [4, 3, 3, 3, 1];
%e [13, 11, 7, 6, 4, 1];
%e [42, 37, 23, 14, 10, 5, 1];
%p C:=(1-sqrt(1-4*z))/2/z: G:=(1-z)/(1-z*C+z^2*C-t*z): Gserz:=simplify(series(G,z=0,16)): P[0]:=1: for n from 1 to 14 do P[n]:=sort(coeff(Gserz,z^n)) od: seq([subs(t=0,P[n]),seq(coeff(P[n],t^k),k=1..n)],n=0..14);
%p # second Maple program:
%p b:= proc(x, y, u, t) option remember; expand(`if`(y<0 or y>x, 0,
%p `if`(x=0, `if`(t, z, 1), (b(x-1, y-1, false, t)+
%p b(x-1, y+1, true, t and u or y=0))*`if`(t and y=0, z, 1))))
%p end:
%p T:= n-> (p-> seq(coeff(p,z,i), i=0..n))(b(2*n, 0, false$2)):
%p seq(T(n), n=0..12); # _Alois P. Heinz_, Jul 22 2015
%t b[x_, y_, u_, t_] := b[x, y, u, t] = Expand[If[y<0 || y>x, 0, If[x==0, If[ t, z, 1], (b[x-1, y-1, False, t] + b[x-1, y+1, True, t && u || y == 0]) * If[t && y==0, z, 1]]]]; T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 0, n}]][b[2*n, 0, False, False]]; Table[T[n], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Jan 29 2016, after _Alois P. Heinz_ *)
%Y Cf. A082989, A000108.
%K nonn,tabl
%O 0,9
%A _Emeric Deutsch_, Jun 03 2004