%I #16 Feb 08 2017 06:26:02
%S 1,1,2,3,1,5,2,1,8,5,3,1,13,10,8,5,1,21,20,18,14,8,1,34,38,39,35,26,
%T 12,1,55,71,80,80,70,49,17,1,89,130,160,174,169,142,90,23,1,144,235,
%U 312,365,385,363,290,158,30,1,233,420,598,745,840,861,785,588,264,38,1
%N Triangle read by rows: T(n,k) is the number of weighted lattice paths B(n) for which the area between the path and the lines y=0 and y=1 is equal to k. B(n) is the set of lattice paths of weight n that start in (0,0), end on the horizontal axis and never go below this axis, whose steps are of the following four kinds: an (1,0)-step of weight 1; an (1,0)-step of weight 2; a (1,1)-step of weight 2; a (1,-1)-step of weight 1. The weight of a path is the sum of the weights of its steps.
%C Number of entries in row n is n-1 (n>=2).
%C Sum of entries in row n is A004148(n+1) (the 2ndary structure numbers).
%C T(n,0) = A000045(n+1) (the Fibonacci numbers).
%C T(n,1) = A001629(n-1). - _Robert Israel_, Aug 28 2014
%H Alois P. Heinz, <a href="/A246185/b246185.txt">Rows n = 0..150, flattened</a>
%H M. Bona and A. Knopfmacher, <a href="http://dx.doi.org/10.1007/s00026-010-0060-7">On the probability that certain compositions have the same number of parts</a>, Ann. Comb., 14 (2010), 291-306.
%F G.f. g = g(t,z) satisfies (t*z^3 + z^2 - t*z^2 + z - t*z - 1 + t)*g^2 +(1 - 2*t + t*z + t*z^2)*g + t = 0.
%F The above equation for g = G(t,1,z) follows from the trivariate g.f. G(t,w,z), where z marks weight, t marks the considered area, and w marks the length of the path (= number of steps) and which satisfies G(t,w,z) = 1 + w*z*G(t,w,z) + w*z^2*G(t,w,z) + t*w^2*z^3*G(t,w,z)*G(1,tw,z).
%e Row 3 is 3, 1. Indeed, denoting by h (H) the (1,0)-step of weight 1 (2), and u=(1,1), d=(1,-1), the four paths of weight 3 are ud, hH, Hh, and hhh; the areas to be considered are 1, 0, 0, and 0, respectively.
%e Triangle starts:
%e 1;
%e 1;
%e 2;
%e 3, 1;
%e 5, 2, 1;
%e 8, 5, 3, 1;
%e 13,10, 8, 5, 1;
%e ...
%p eq := (t*z^3+z^2-t*z^2+z-t*z-1+t)*g^2+(t*z^2+t*z+1-2*t)*g+t = 0: g := RootOf(eq, g,1): gser := simplify(series(g, z = 0, 20)): for n from 0 to 17 do P[n] := sort(coeff(gser, z, n)) end do: 1; 1; for n from 2 to 17 do seq(coeff(P[n], t, j), j = 0 .. n-2) end do; # yields sequence in triangular form
%p # second Maple program:
%p b:= proc(n, y) option remember; `if`(y<0 or y>n, 0, `if`(n=0, 1,
%p expand(b(n-1, y)*x^min(1, y)+`if`(n>1, b(n-2, y)*x^min(1, y)+
%p b(n-2, y+1)*x^min(y+1/2, 1), 0)+b(n-1, y-1)*x^min(y-1/2, 1))))
%p end:
%p T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
%p seq(T(n), n=0..20); # _Alois P. Heinz_, Aug 28 2014
%t b[n_, y_] := b[n, y] = If[y<0 || y>n, 0, If[n==0, 1, Expand[b[n-1, y] * x^Min[1, y] + If[n>1, b[n-2, y]*x^Min[1, y] + b[n-2, y+1]*x^Min[y+1/2, 1], 0] + b[n-1, y-1]*x^Min[y-1/2, 1]]]]; T[n_] := Function[p, Table[ Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 20}] // Flatten (* _Jean-François Alcover_, Feb 08 2017, after _Alois P. Heinz_ *)
%Y Cf. A004148, A000045, A246177.
%K nonn,tabf
%O 0,3
%A _Emeric Deutsch_, Aug 28 2014