A162984 Number of Dyck paths with no UUU's and no DDD's of semilength n and having k UUDUDD's (0<=k<=floor(n/3); U=(1,1), D=(1,-1)).
1, 1, 2, 3, 1, 6, 2, 12, 5, 25, 11, 1, 53, 26, 3, 114, 62, 9, 249, 148, 25, 1, 550, 355, 69, 4, 1227, 853, 189, 14, 2760, 2057, 509, 46, 1, 6253, 4973, 1359, 145, 5, 14256, 12050, 3600, 446, 20, 32682, 29256, 9484, 1334, 75, 1, 75293, 71154, 24870, 3914, 265, 6
Offset: 0
Examples
T(4,1) = 2 because we have UDUUDUDD and UUDUDDUD. Triangle starts: 1; 1; 2; 3, 1; 6, 2; 12, 5; 25, 11, 1; 53, 26, 3;
Links
- Alois P. Heinz, Rows n = 0..250, flattened
- M. Bona and A. Knopfmacher, On the probability that certain compositions have the same number of parts, Ann. Comb., 14 (2010), 291-306.
Programs
-
Maple
G := ((1-z-z^2+z^3-t*z^3-sqrt(1-2*z-z^2-2*t*z^3-z^4-2*z^5+z^6+2*t*z^4+2*t*z^5-2*t*z^6+t^2*z^6))*1/2)/z^3: Gser := simplify(series(G, z = 0, 20)): for n from 0 to 16 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 16 do seq(coeff(P[n], t, j), j = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form # second Maple program: b:= proc(x, y, t) option remember; `if`(y<0 or y>x or t=9, 0, `if`(x=0, 1, expand(b(x-1, y+1, [2, 3, 9, 5, 3, 2, 2, 2][t])+ `if`(t=6, z, 1) *b(x-1, y-1, [8, 8, 4, 7, 6, 7, 9, 7][t])))) end: T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0, 1)): seq(T(n), n=0..20); # Alois P. Heinz, Jun 10 2014
-
Mathematica
b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x || t == 9, 0, If[x == 0, 1, Expand[b[x-1, y+1, {2, 3, 9, 5, 3, 2, 2, 2}[[t]] ] + If[t == 6, z, 1]*b[x-1, y-1, {8, 8, 4, 7, 6, 7, 9, 7}[[t]] ]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, 1]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, May 27 2015, after Alois P. Heinz *)
Comments