OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2500
Wikipedia, Counting lattice paths
MAPLE
b:= proc(x, y) option remember; `if`(min(x, y)<0 or y>x, 0, `if`(
max(x, y)=0, [1$2], (p-> p+[0, p[1]])(b(x-1, y)+b(x, y-1))))
end:
a:= n-> add(b(i, n-2*i), i=ceil(n/3)..floor(n/2))[2]:
seq(a(n), n=0..39);
MATHEMATICA
b[x_, y_] := b[x, y] = If[Min[x, y] < 0 || y > x, {0, 0}, If[Max[x, y] == 0, {1, 1}, Function[p, p + {0, p[[1]]}][b[x - 1, y] + b[x, y - 1]]]];
a[n_] := If[n == 1, 0, Sum[b[i, n - 2i], {i, Ceiling[n/3], Floor[n/2]}][[2]]];
Table[a[n], {n, 0, 39}] (* Jean-François Alcover, May 27 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Oct 07 2022
STATUS
approved