OFFSET
0,3
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..150
Wikipedia, Counting lattice paths
FORMULA
a(n) = A107876(2n,n).
EXAMPLE
a(0) = 1: the empty path.
a(1) = 1: uudd.
a(2) = 3: uuuduuuudddddd, uuudduuuuddddd, uuuddduuuudddd.
MAPLE
a:= proc(m) option remember; local b; b:=
proc(n, i) option remember; `if`(i>=2*m, 1,
add(b(n+i-j, i+1), j=1..n+i))
end; b(0, m+1)
end:
seq(a(n), n=0..20);
MATHEMATICA
a[m_] := a[m] = Module[{b}, b[n_, i_] := b[n, i] = If[i >= 2m, 1, Sum[b[n + i - j, i + 1], {j, 1, n + i}]]; b[0, m + 1]];
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 02 2018, from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Mar 16 2018
STATUS
approved