OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..224
Alois P. Heinz, Animation of a(2)=111 walks
Wikipedia, Lattice path
Wikipedia, Self-avoiding walk
MAPLE
b:= proc(n) option remember; `if`(n<2, n+1,
(n+irem(n, 2))*b(n-1)+(n-1)*b(n-2))
end:
a:= n-> b(2*n):
seq(a(n), n=0..15);
# second Maple program:
a:= proc(n) option remember; `if`(n<2, 4*n+1,
((2*n+1)^2-2)*a(n-1)-(4*n-6)*n*a(n-2))
end:
seq(a(n), n=0..15);
MATHEMATICA
a[n_] := a[n] = If[n<2, 4n+1, ((2n+1)^2-2) a[n-1] - (4n-6) n a[n-2]];
Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Jun 19 2017, after 2nd Maple program *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Mar 27 2017
STATUS
approved