OFFSET
2,2
LINKS
Alois P. Heinz, Rows n = 2..200, flattened
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
Emeric Deutsch, S Elizalde, Statistics on bargraphs viewed as cornerless Motzkin paths, arXiv preprint arXiv:1609.00088, 2016
FORMULA
G.f.: G = (1-2z+z^2-2tz^2-sqrt((1-z)((1-z)^3-4tz^2*(1-z+tz))))/(2tz).
EXAMPLE
Row 4 is 3,2 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 1,2,2,1,1 horizontal segments.
Triangle starts
1;
2;
3,2;
4,8,1;
5,20,10;
6,40,45,6.
MAPLE
G := ((1-2*z+z^2-2*t*z^2-sqrt((1-z)*((1-z)^3-4*t*z^2*(1-z+t*z))))*(1/2))/(t*z): Gser := simplify(series(G, z = 0, 23)): for n from 2 to 18 do P[n] := sort(expand(coeff(Gser, z, n))) end do: for n from 2 to 18 do seq(coeff(P[n], t, j), j = 1 .. degree(P[n])) end do; # yields sequence in triangular form
# second Maple program:
b:= proc(n, y, t) option remember; expand(
`if`(n=0, (1-t), `if`(t<0, 0, b(n-1, y+1, 1))+
`if`(t>0 or y<2, 0, b(n, y-1, -1))+
`if`(y<1, 0, b(n-1, y, 0)*`if`(t=0, 1, z))))
end:
T:= n-> (p-> seq(coeff(p, z, i), i=1..degree(p)))(b(n, 0$2)):
seq(T(n), n=2..20); # Alois P. Heinz, Jun 27 2016
MATHEMATICA
b[n_, y_, t_] := b[n, y, t] = Expand[If[n == 0, 1 - t, If[t < 0, 0, b[n - 1, y + 1, 1]] + If[t > 0 || y < 2, 0, b[n, y - 1, -1]] + If[y < 1, 0, b[n - 1, y, 0]*If[t == 0, 1, z]]]]; T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 1, Exponent[p, z]}]][b[n, 0, 0]]; Table[T[n], {n, 2, 20}] // Flatten (* Jean-François Alcover, Dec 02 2016, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Emeric Deutsch and Sergi Elizalde, Jun 27 2016
STATUS
approved