OFFSET
2,5
COMMENTS
LINKS
A. Blecher, C. Brennan, A. Knopfmacher, and H. Prodinger, The height and width of bargraphs, Discrete Applied Math. 180, (2015), 36-44.
FORMULA
Formula (explained on the Maple program): eq is the recursion equation given in Sec. 2 of the Blecher et al. reference; ic is the initial condition; the resulting g[j]'s agree with the generating functions given in the table on p. 39 of the Blecher et al. reference; H[j]=g[j]-g[j-1]; Hser[j] is the series expansion of H[j], yielding the entries in column j of the triangle T.
EXAMPLE
T(4,2)=3; indeed, the bargraphs of semiperimeter 4 correspond to the compositions [3], [1,2], [2,2], [2,1], [1,1,1], three of which have height 2.
Triangle begins:
1;
1, 1;
1, 3, 1;
1, 6, 5, 1;
1, 11, 15, 7, 1;
...
MAPLE
x := z: y := z: eq := G(h) = x*(y+G(h))+y*G(h-1)+x*(y+G(h))*G(h-1): ic := G(1) = x*y/(1-x): sol := simplify(rsolve({eq, ic}, G(h))): for j to 17 do g[j] := factor(simplify(rationalize(simplify(subs(h = j, sol))))) end do: H[1] := x*y/(1-x): for j from 2 to 17 do H[j] := factor(g[j]-g[j-1]) end do: for j to 17 do Hser[j] := series(H[j], z = 0, 20) end do: T := proc (n, k) coeff(Hser[k], z, n) end proc: for n from 2 to 15 do seq(T(n, k), k = 1 .. n-1) end do; # yields sequence in triangular form
MATHEMATICA
x = y = z;
eq = G[h] == x*(y + G[h]) + y*G[h - 1] + x*(y + G[h])*G[h - 1];
ic = G[1] == x*y/(1 - x);
sol = RSolve[{eq, ic}, G[h], h];
For[j = 1, j <= 17, j++, g[j] = G[h] /. sol /. h -> j];
H[1] = x*y/(1 - x);
For[j = 2, j <= 17, j++, H[j] = g[j] - g[j - 1]];
For[j = 1, j <= 17, j++, Hser[j] = Series[H[j][[1]], {z, 0, 20}]];
T[n_, k_] := Coefficient[Hser[k], z, n];
Table[T[n, k], {n, 2, 15}, {k, 1, n - 1}] // Flatten (* Jean-François Alcover, Sep 14 2024, after Maple program *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Emeric Deutsch, Dec 31 2016
STATUS
approved