OFFSET
2,3
LINKS
M. Bousquet-Mélou and A. Rechnitzer, The site-perimeter of bargraphs, Adv. in 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)=(1-z)^3*(1-2z-z^2-Q)/(2zQ), where Q = sqrt((1-z)(1-3z-z^2-z^3)).
a(n) = Sum(k*A274491(n,k), k>=0).
D-finite with recurrence (n+1)*a(n) +3*(-2*n+1)*a(n-1) +3*(3*n-8)*a(n-2) +6*(1)*a(n-3) +(-n+19)*a(n-4) +(-2*n+15)*a(n-5) +(-n+8)*a(n-6)=0. - R. J. Mathar, Jul 22 2022
EXAMPLE
a(4)=5 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] and the corresponding pictures give the values 0,2,2,0,1 for the number of horizontal segments of length 1.
MAPLE
g:=(1/2)*(1-z)^3*(1-2*z-z^2-Q)/(z*Q): Q:=sqrt((1-z)*(1-3*z-z^2-z^3)): gser:= series(g, z=0, 30): seq(coeff(gser, z, n), n=2..27);
MATHEMATICA
g = (1-z)^3 (1-2z-z^2-Q)/(2z Q) /. Q -> Sqrt[(1-z)(1-3z-z^2-z^3)];
a[n_] := SeriesCoefficient[g, {z, 0, n}];
Table[a[n], {n, 2, 29}] (* Jean-François Alcover, Jul 25 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch and Sergi Elizalde, Jun 27 2016
STATUS
approved