OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..600
Wikipedia, Counting lattice paths
Wikipedia, Fibonacci number
EXAMPLE
a(4) = 13 = A000108(4) - 1 because one Dyck path of semilength 4 has 4 peaks in the first level and 4 is not a Fibonacci number: /\/\/\/\.
MAPLE
q:= n-> (t-> issqr(t+4) or issqr(t-4))(5*n^2):
b:= proc(n, j) option remember; `if`(n=j, 1, add(b(n-j, i)*
add(`if`(q(t), binomial(i, t)*binomial(j-1, i-1-t), 0),
t=max(0, i-j)..min(n-j, i-1)), i=1..n-j))
end:
a:= n-> `if`(n=0, 1, add(`if`(q(k), b(n, k), 0), k=1..n)):
seq(a(n), n=0..30);
MATHEMATICA
q[n_] := Function[t, IntegerQ @ Sqrt[t+4] || IntegerQ @ Sqrt[t-4]][5n^2];
b[n_, j_] := b[n, j] = If[n == j, 1, Sum[b[n - j, i]*Sum[If[q[t], Binomial[i, t]*Binomial[j - 1, i - 1 - t], 0], {t, Max[0, i - j], Min[n - j, i - 1]}], {i, 1, n - j}]];
a[n_] := If[n == 0, 1, Sum[If[q[k], b[n, k], 0], {k, 1, n}]];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 02 2018, from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 08 2017
STATUS
approved