OFFSET
2,3
LINKS
M. Bousquet-Mélou and A. Rechnitzer The site-perimeter of bargraphs Adv. Appl. Math., 31, 2003, 86-112.
Emeric Deutsch, S Elizalde, Statistics on bargraphs viewed as cornerless Motzkin paths, arXiv preprint arXiv:1609.00088, 2016
FORMULA
G.f.: g = z^2*(1 + z^2 + Q)/(2*Q), where Q = sqrt(1-4*z+2*z^2+z^4).
a(n) = Sum(k*A273715(n,k), k>=1).
D-finite with recurrence (n-2)*(2*n-9)*a(n) +(2*n^2-29*n+75)*a(n-1) -6*(2*n-7)*(3*n-17)*a(n-2) +10*(2*n-9)*(n-5)*a(n-3) +(2*n-5)*(n-6)*a(n-4) +5*(2*n-7)*(n-7)*a(n-5)=0. - R. J. Mathar, Jun 02 2016
EXAMPLE
a(4)=3 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] and, clearly, they have 0, 1, 1, 0, 1 peaks of width 1..
MAPLE
g := (1/2)*z^2*(1+z^2+sqrt(1-4*z+2*z^2+z^4))/sqrt(1-4*z+2*z^2+z^4): gser := series(g, z = 0, 40): seq(coeff(gser, z, n), n = 2 .. 35);
MATHEMATICA
b[n_, y_, t_, h_] := b[n, y, t, h] = Expand[If[n == 0, (1 - t)*z^h, If[t < 0, 0, b[n - 1, y + 1, 1, 0]] + If[t > 0 || y < 2, 0, b[n, y - 1, -1, 0]*z^h] + If[y < 1, 0, b[n - 1, y, 0, If[t > 0, 1, 0]]]]];
a[n_] := Module[{cc}, cc = Function[p, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[n, 0, 0, 0]]; cc.Range[0, Length[cc]-1]];
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, May 28 2016
STATUS
approved