OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Wikipedia, Lattice path
Wikipedia, Self-avoiding walk
FORMULA
a(n) = (n+1) * A328280(n).
MAPLE
b:= proc(l) option remember; `if`(l[-1]=0, 1, (r-> add(
add(add(`if`(i+j+k=1, (h-> `if`(h[1]<0, 0, b(h)))(
sort(l-[i, j, k])), 0), k=r), j=r), i=r))([$-1..1]))
end:
a:= n-> (t-> (n+1)*b([0, t, n-t]))(iquo(n, 2)):
seq(a(n), n=0..31);
MATHEMATICA
b[l_] := b[l] = If[Last[l] == 0, 1, Function[r, Sum[If[i + j + k == 1, Function[h, If[h[[1]] < 0, 0, b[h]]][Sort[l - {i, j, k}]], 0], {i, r}, {j, r}, {k, r}]][{-1, 0, 1}]];
a[n_] := Function[t, (n + 1) b[{0, t, n - t}]][Quotient[n, 2]];
a /@ Range[0, 31] (* Jean-François Alcover, May 13 2020, after Maple *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Alois P. Heinz, Oct 10 2019
STATUS
approved