A274492 Number of horizontal segments of length 1 in all bargraphs of semiperimeter n (n>=2). By a horizontal segment of length 1 we mean a horizontal step that is not adjacent to any other horizontal step.
1, 1, 5, 16, 52, 170, 556, 1821, 5973, 19620, 64536, 212553, 700903, 2313864, 7646670, 25294673, 83748689, 277518319, 920332567, 3054319120, 10143305864, 33707066667, 112078220233, 372875904038, 1241182355688, 4133534991928, 13772413826888, 45908128269573
Offset: 2
Keywords
Examples
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.
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
Programs
-
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 *)
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