OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Wikipedia, Counting lattice paths
Wikipedia, Motzkin number
FORMULA
a(n) = (n+1) * A333069(n).
a(n) ~ c * 4^n / sqrt(n), where c = 0.0131789402414023971902275212293294628834887666310830183578424168829... - Vaclav Kotesovec, Oct 24 2021
MAPLE
b:= proc(x, y) option remember; `if`(x=0, 1, add(
`if`(x+j>y, b(x-1, y-j), 0), j=-1-y..min(1, y)))
end:
a:= n-> (n+1)*b(n, 0):
seq(a(n), n=0..30);
MATHEMATICA
b[x_, y_] := b[x, y] = If[x == 0, 1, Sum[
If[x + j > y, b[x - 1, y - j], 0], {j, -1 - y, Min[1, y]}]];
a[n_] := (n+1) b[n, 0];
a /@ Range[0, 30] (* Jean-François Alcover, Apr 05 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Mar 06 2020
STATUS
approved