OFFSET
0,3
COMMENTS
The semilengths of Dyck paths counted by a(n) are elements of the integer interval [n^2+n-1, n^2*(n+1)/2] for n>0.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..15
Wikipedia, Counting lattice paths
EXAMPLE
. a(1) = 1: /\ .
.
. a(2) = 9: /\/\ /\/\ /\/\ /\ /\
. /\/\/ \ /\/ \/\ / \/\/\ /\/\/ \/ \
.
. /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
. /\/ \/\/ \ /\/ \/ \/\ / \/\/\/ \ / \/\/ \/\ / \/ \/\/\ .
MAPLE
b:= proc(n, k, j, v) option remember; `if`(n=j, `if`(v=1, 1, 0),
`if`(v<2, 0, add(b(n-j, k, i, v-1)*(binomial(i, k)
*binomial(j-1, i-1-k)), i=1..min(j+k, n-j))))
end:
a:= n-> `if`(n=0, 1, add(b(k, n$3), k=n^2+n-1..n^2*(n+1)/2)):
seq(a(n), n=0..7);
MATHEMATICA
b[n_, k_, j_, v_]:=b[n, k, j, v]=If[n==j, If[v==1, 1, 0], If[v<2, 0, Sum[b[n - j, k, i, v - 1] Binomial[i, k] Binomial[j - 1, i - 1 - k], {i, Min[j + k, n - j]}]]]; a[n_]:=If[n==0, 1, Sum[b[k, n, n, n], {k, n^2 + n - 1, n^2*(n + 1)/2}]]; Table[a[n], {n, 0, 8}] (* Indranil Ghosh, Jul 06 2017, after Maple code *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 19 2017
STATUS
approved