OFFSET
2,2
COMMENTS
A descent in a bargraph is a maximal sequence of adjacent down steps.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..1000
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-4z+3z^2-(1-2z)Q)/(2z^3), where Q = sqrt(1-4z+2z^2+z^4).
a(n) = Sum(k*A273897(n,k), k>=1).
D-finite with recurrence (n+3)*a(n) +2*(-3*n-4)*a(n-1) +2*(5*n-2)*a(n-2) +4*(-n+2)*a(n-3) +(n-3)*a(n-4) +2*(-n+5)*a(n-5)=0. - R. J. Mathar, Jul 24 2022
EXAMPLE
a(4)=9 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 3,2,1,2,1 for the abscissae of their first descents.
MAPLE
g := ((1-4*z+3*z^2-(1-2*z)*Q)*(1/2))/z^3: Q := sqrt(1-4*z+2*z^2+z^4): gser := series(g, z = 0, 40): seq(coeff(gser, z, n), n = 2 .. 35);
# second Maple program:
a:= proc(n) option remember; `if`(n<4, [0$2, 1, 3][n+1],
((2*(14*n^2+6+13*n))*a(n-1)-(2*(7*n^2-6-4*n))*a(n-2)
+12*a(n-3) -(n-4)*(3+7*n)*a(n-4))/((n+3)*(7*n-4)))
end:
seq(a(n), n=2..40); # Alois P. Heinz, Jun 07 2016
MATHEMATICA
a[n_] := a[n] = If[n<4, {0, 0, 1, 3}[[n+1]], ((2*(14*n^2+6+13*n))*a[n-1] - (2*(7*n^2-6-4*n))*a[n-2] + 12*a[n-3] - (n-4)*(3+7*n)*a[n-4])/((n+3)*(7*n - 4))]; Table[a[n], {n, 2, 40}] (* Jean-François Alcover, Dec 02 2016 after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Jun 06 2016
STATUS
approved