%I #15 Sep 14 2024 13:25:11
%S 1,3,10,32,101,318,1003,3173,10071,32071,102453,328260,1054620,
%T 3396757,10965653,35475159,114989969,373400210,1214529314,3956450250,
%U 12906762704,42159475998,137877383739,451403471067,1479329370617,4852295325254,15928202158814,52321416289743,171966242037941,565480887258368,1860228812665716,6121446895971437
%N The sum of the heights of all bargraphs of semiperimeter n (n>=2).
%H A. Blecher, C. Brennan, A. Knopfmacher and H. Prodinger, <a href="https://doi.org/10.1016/j.dam.2014.08.026">The height and width of bargraphs</a>, Discrete Applied Math. 180, (2015), 36-44 (see pp. 41-42).
%F a(n) = Sum_{k>=0} k*A278132(n,k).
%e 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.
%p 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);
%t x = y = z;
%t eq = G[h] == x*(y + G[h]) + y*G[h - 1] + x*(y + G[h])*G[h - 1];
%t ic = G[1] == x*y/(1 - x);
%t sol = RSolve[{eq , ic}, G[h], h];
%t For[j = 1, j <= 17, j++, g[j] = G[h] /. sol /. h -> j];
%t H[1] = x*y/(1 - x);
%t For[j = 2, j <= 50, j++, H[j] = g[j] - g[j - 1]];
%t For[j = 1, j <= 17, j++, Hser[j] = Series[H[j][[1]], {z, 0, 50}]];
%t T[n_, k_] := Coefficient[Hser[k], z, n];
%t a[n_] := Sum[k*T[n, k], {k, 1, n - 1}];
%t Table[a[n], {n, 2, 45}] (* _Jean-François Alcover_, Sep 14 2024, after Maple program *)
%Y Cf. A278132.
%K nonn
%O 2,2
%A _Emeric Deutsch_, Dec 31 2016