OFFSET
1,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
M. Bousquet-Mélou and A. Rechnitzer, The site-perimeter of bargraphs, Adv. in Appl. Math. 31 (2003), 86-112.
FORMULA
The generating function is known in closed form. Closed, but complicated. It is proved to be non-D-finite.
MAPLE
b:= proc(n, y, t, w) option remember; `if`(n<0, 0, `if`(n=0, (1-t),
`if`(t<0, 0, b(n-`if`(w>0 or t=0, 1, 2), y+1, 1, max(0, w-1)))+
`if`(t>0 or y<2, 0, b(n, y-1, -1, `if`(t=0, 1, w+1)))+
`if`(y<1, 0, b(n-`if`(t<0, 1, 2), y, 0, `if`(t<0, w, 0)))))
end:
a:= n-> b(n, 0, 1, 0):
seq(a(n), n=1..45); # Alois P. Heinz, Jun 05 2016
MATHEMATICA
b[n_, y_, t_, w_] := b[n, y, t, w] = If[n<0, 0, If[n==0, 1-t, If[t<0, 0, b[n - If[w>0 || t==0, 1, 2], y+1, 1, Max[0, w-1]]] + If[t>0 || y<2, 0, b[n, y-1, -1, If[t==0, 1, w+1]]] + If[y<1, 0, b[n - If[t<0, 1, 2], y, 0, If[t<0, w, 0]]]]]; a[n_] := b[n, 0, 1, 0]; Table[a[n], {n, 1, 45}] (* Jean-François Alcover, Nov 28 2016 after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Rechnitzer (a.rechnitzer(AT)ms.unimelb.edu.au), Sep 09 2002
EXTENSIONS
Offset corrected by Alois P. Heinz, Jun 04 2016
a(31)-a(38) from Alois P. Heinz, Jun 05 2016
STATUS
approved