%I #19 Apr 29 2015 08:56:17
%S 1,2,4,2,10,8,2,26,30,12,2,70,104,60,16,2,192,350,260,100,20,2,534,
%T 1152,1050,520,150,24,2,1500,3738,4032,2450,910,210,28,2,4246,12000,
%U 14952,10752,4900,1456,280,32,2,12092,38214,54000,44856,24192,8820,2184,360,36,2
%N Triangle read by rows: a(n,k) = number of paths of n upsteps U and n downsteps D that contain k UDUs.
%C See A091869 for the distribution of the parameter "number of UDUs" on Dyck paths.
%D Aristidis Sapounakis, Panagiotis Tsikouras, Ioannis Tasoulas, Kostas Manes, Strings of Length 3 in Grand-Dyck Paths and the Chung-Feller Property, Electr. J. Combinatorics, 19 (2012), #P2. - From _N. J. A. Sloane_, Feb 06 2013
%H Alois P. Heinz, <a href="/A097692/b097692.txt">Rows n = 0..141, flattened</a>
%F G.f.: ((1 + x - x*y)/(1 - 3*x - x*y))^(1/2) = Sum_{n>=0, k>=0} a(n,k) x^n y^k.
%e Table begins
%e \ k 0, 1, 2, ...
%e n
%e 0 | 1
%e 1 | 2
%e 2 | 4, 2
%e 3 | 10, 8, 2
%e 4 | 26, 30, 12, 2
%e 5 | 70, 104, 60, 16, 2
%e 6 |192, 350, 260, 100, 20, 2
%e 7 |534, 1152, 1050, 520, 150, 24, 2
%e The path UDUDUD contains 2 UDUs and a(2,1) = 2 because each of UDUD, DUDU contains one UDU.
%p b:= proc(u, d, t) option remember; `if`(u=0 and d=0, 1,
%p expand(`if`(u=0, 0, b(u-1, d, 2)*`if`(t=3, x, 1))
%p +`if`(d=0, 0, b(u, d-1, `if`(t=2, 3, 1)))))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n$2, 1)):
%p seq(T(n), n=0..12); # _Alois P. Heinz_, Apr 29 2015
%t gfForBalancedByNumberUDU=Sqrt[(1 + x - x*y)/(1 - 3*x - x*y)]; Map[CoefficientList[ #, y]&, CoefficientList[Normal[Series[gfForBalancedByNumberUDU, {x, 0, 8}, {y, 0, 8}]], x]]
%Y Column k=0 is A025565. The row sums are the (even) central binomial coefficients A000984.
%Y Cf. A171651.
%K nonn,tabf
%O 0,2
%A _David Callan_, Aug 19 2004; corrected Jun 10 2005
%E Keyword tabl changed to tabf by _Michel Marcus_, Apr 07 2013