OFFSET
2,2
LINKS
A. Blecher, C. Brennan, A. Knopfmacher and H. Prodinger, The height and width of bargraphs, Discrete Applied Math. 180, (2015), 36-44 (see pp. 41-42).
FORMULA
a(n) = Sum_{k>=0} k*A278132(n,k).
EXAMPLE
a(4)=10; indeed, the bargraphs of semiperimeter 4 correspond to the compositions [3],[1,2],[2,2],[2,1],[1,1,1] and the sum of their heights is 3+2+2+2+1=10.
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 50 do H[j] := factor(g[j]-g[j-1]) end do: for j to 17 do Hser[j] := series(H[j], z = 0, 50) end do: T := proc (n, k) coeff(Hser[k], z, n) end proc: seq(add(k*T(n, k), k = 1 .. n-1), n = 2 .. 45);
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 <= 50, j++, H[j] = g[j] - g[j - 1]];
For[j = 1, j <= 17, j++, Hser[j] = Series[H[j][[1]], {z, 0, 50}]];
T[n_, k_] := Coefficient[Hser[k], z, n];
a[n_] := Sum[k*T[n, k], {k, 1, n - 1}];
Table[a[n], {n, 2, 45}] (* Jean-François Alcover, Sep 14 2024, after Maple program *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Dec 31 2016
STATUS
approved