login
Triangle read by rows: T(n,k) is the number of dispersed Dyck paths of semilength n (i.e., Motzkin paths of length n with no (1,0)-steps at positive heights) for which the sum of the lengths of the initial and final horizontal segments is k (0<=k<=n).
1

%I #13 Aug 30 2024 09:44:21

%S 1,0,1,1,0,1,0,2,0,1,2,0,3,0,1,1,4,0,4,0,1,6,2,6,0,5,0,1,5,12,3,8,0,6,

%T 0,1,20,10,18,4,10,0,7,0,1,21,40,15,24,5,12,0,8,0,1,70,42,60,20,30,6,

%U 14,0,9,0,1,84,140,63,80,25,36,7,16,0,10,0,1,252,168,210,84,100,30,42,8,18,0,11,0,1

%N Triangle read by rows: T(n,k) is the number of dispersed Dyck paths of semilength n (i.e., Motzkin paths of length n with no (1,0)-steps at positive heights) for which the sum of the lengths of the initial and final horizontal segments is k (0<=k<=n).

%C Sum of entries in row n is binomial(n, floor(n/2)) = A001405(n).

%C T(n,0) = A191529(n).

%C Sum_{k>=0} k*T(n,k) = A191531(n).

%F T(2n,0) = binomial(2n-2,n-1) (n>=1); T(2n+1,0) = binomial(2n-1,n-2) (n>=1).

%F T(n,k) = (k+1)T(n-k,0).

%F G.f.: G(t,z) = (2 - 3z - tz + 2tz^2 + (1-t)z*sqrt(1-4z^2))/((1 - 2z + sqrt(1-4z^2))(1-tz)^2).

%e T(5,3)=4 because we have HHHUD, HHUDH, HUDHH, and UDHHH, where U=(1,1), H=(1,0), and D=(1,-1).

%e Triangle starts:

%e 1;

%e 0, 1;

%e 1, 0, 1;

%e 0, 2, 0, 1;

%e 2, 0, 3, 0, 1;

%e 1, 4, 0, 4, 0, 1;

%e 6, 2, 6, 0, 5, 0, 1;

%p q := sqrt(1-4*z^2): G := (2-3*z-t*z+2*t*z^2+(1-t)*z*q)/((1-2*z+q)*(1-t*z)^2): Gser := simplify(series(G, z = 0, 15)): for n from 0 to 12 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 12 do seq(coeff(P[n], t, k), k = 0 .. n) end do; # yields sequence in triangular form

%p T := proc (n, k) if n < k then 0 elif k = n then 1 elif k = 0 and n = 1 then 0 elif k = 0 and `mod`(n, 2) = 0 then binomial(n-2, (1/2)*n-1) elif k = 0 and `mod`(n, 2) = 1 then binomial(n-2, (1/2)*n-5/2) else (1+k)*T(n-k, 0) end if end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. n) end do; # yields sequence in triangular form

%t T[n_, k_] := Which[n < k, 0,

%t k == n, 1,

%t k == 0 && n == 1, 0,

%t k == 0 && Mod[n, 2] == 0, Binomial[n - 2, n/2 - 1],

%t k == 0 && Mod[n, 2] == 1, Binomial[n - 2, (n - 5)/2],

%t True, (1 + k)*T[n - k, 0]];

%t Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Aug 30 2024, after 2nd Maple program *)

%Y Cf. A001405, A191529, A191531.

%K nonn,tabl

%O 0,8

%A _Emeric Deutsch_, Jun 07 2011