OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..555
Wikipedia, Counting lattice paths
EXAMPLE
a(3) = 3: /\
/ \ /\ /\
/ \ / \/\ /\/ \ .
MAPLE
b:= proc(x, y, h, t) option remember;
`if`(y<0 or y>x, 0, `if`(x=0, 1, b(x-1, y+1, h, 1)+
`if`(t=0 or y<>h, b(x-1, y-1, `if`(t=1, y, h), 0), 0)))
end:
a:= n-> b(2*n, 0$3):
seq(a(n), n=0..30);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 03 2024
STATUS
approved