A094322 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength n having k pyramids.
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, 122, 78, 43, 25, 15, 6, 1, 470, 408, 262, 145, 75, 41, 21, 7, 1, 1616, 1390, 887, 494, 251, 124, 63, 28, 8, 1, 5632, 4810, 3048, 1694, 864, 414, 196, 92, 36, 9, 1, 19852, 16857, 10622
Offset: 0
Examples
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). Triangle begins: [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];
Links
- Alois P. Heinz, Rows n = 0..140, flattened
Programs
-
Maple
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); # second Maple program: b:= proc(x, y, u, t) option remember; expand(`if`(y<0 or y>x, 0, `if`(x=0, `if`(t, z, 1), (b(x-1, y-1, false, t)+ b(x-1, y+1, true, t and u or y=0))*`if`(t and y=0, z, 1)))) end: T:= n-> (p-> seq(coeff(p,z,i), i=0..n))(b(2*n, 0, false$2)): seq(T(n), n=0..12); # Alois P. Heinz, Jul 22 2015
-
Mathematica
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 *)
Formula
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.
Comments