OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..500
Wikipedia, Counting lattice paths
EXAMPLE
. a(3) = 3: /\ /\
. /\/\/\ /\/ \ / \/\ .
.
. a(5) = 8:
. /\/\ /\/\ /\/\
. /\/\/\/\/\ /\/\/ \ /\/ \/\ / \/\/\
.
. /\ /\ /\ /\
. /\/ \ / \/\ /\/ \ / \/\
. /\/ \ /\/ \ / \/\ / \/\ .
MAPLE
b:= proc(n, k, j) option remember; `if`(n=j, 1,
add(binomial(i, k)*binomial(j-1, i-1-k)
*b(n-j, k, i), i=1+k..min(j+k, n-j)))
end:
a:= n-> 1+add(b(n, j$2), j=1..n/2):
seq(a(n), n=0..33);
MATHEMATICA
b[n_, k_, j_] := b[n, k, j] = If[n == j, 1, Sum[Binomial[i, k]*Binomial[j - 1, i - 1 - k]*b[n - j, k, i], {i, 1 + k, Min[j + k, n - j]}]];
a[n_] := 1 + Sum[b[n, j, j], {j, 1, n/2}];
Table[a[n], {n, 0, 33}] (* Jean-François Alcover, May 24 2018, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 03 2017
STATUS
approved