OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1276
Alois P. Heinz, Animation of A327871(5) = 369 walks with a(5) = 6444 nodes
Wikipedia, Lattice path
Wikipedia, Self-avoiding walk
FORMULA
a(n) ~ sqrt(113 - 179/sqrt(13)) * (70 + 26*sqrt(13))^n * sqrt(n) / (sqrt(Pi) * 2^(3/2) * 3^(3*n + 3/2)). - Vaclav Kotesovec, Oct 12 2019
MAPLE
b:= proc(x, y, t) option remember; (p-> p+[0, p[1]])(`if`(
min(x, y)<0, 0, `if`(max(x, y)=0, [1, 0], b(x-1, y, 1)+
`if`(t=1, b(x-1, y+1, 0)+b(x+1, y-1, 0), 0))))
end:
a:= n-> b(n$2, 0)[2]:
seq(a(n), n=0..25);
MATHEMATICA
b[x_, y_, t_] := b[x, y, t] = Function[p, p + {0, p[[1]]}][If[Min[x, y] < 0, {0, 0}, If[Max[x, y] == 0, {1, 0}, b[x - 1, y, 1] + If[t == 1, b[x - 1, y + 1, 0] + b[x + 1, y - 1, 0], 0]]]];
a[n_] := b[n, n, 0][[2]];
a /@ Range[0, 25] (* Jean-François Alcover, May 13 2020, after Maple *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Sep 28 2019
STATUS
approved