OFFSET
0,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2500
Wikipedia, Counting lattice paths
FORMULA
a(n) = Sum_{k=0..floor(n/2)} A120730(n-k, k). - G. C. Greubel, Nov 07 2022
MAPLE
b:= proc(x, y) option remember; `if`(min(x, y)<0 or y>x, 0,
`if`(max(x, y)=0, 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)):
seq(a(n), n=0..44);
MATHEMATICA
A120730[n_, k_]:= If[n>2*k, 0, Binomial[n, k]*(2*k-n+1)/(k+1)];
Table[A357654[n], {n, 0, 50}] (* G. C. Greubel, Nov 07 2022 *)
PROG
(Magma)
A120730:= func< n, k | n gt 2*k select 0 else Binomial(n, k)*(2*k-n+1)/(k+1) >;
[A357654(n): n in [0..50]]; // G. C. Greubel, Nov 07 2022
(SageMath)
def A120730(n, k): return 0 if (n>2*k) else binomial(n, k)*(2*k-n+1)/(k+1)
[A357654(n) for n in range(51)] # G. C. Greubel, Nov 07 2022
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Oct 07 2022
STATUS
approved