|
|
A191756
|
|
Number of n-step four-sided prudent self-avoiding walks.
|
|
3
|
|
|
1, 4, 12, 36, 100, 276, 748, 2012, 5356, 14172, 37276, 97604, 254508, 661364, 1713292, 4426428, 11408300, 29339324, 75305596, 192945124, 493554916, 1260643868, 3215551292, 8191635220, 20843850764, 52980214316, 134527157780, 341268196780
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
MAPLE
|
b:= proc(n, x, y, w, s, i) option remember;
`if`(n=0, 1, `if`(y>s, b(n, x, s, w, y, i),
b(n-1, max(x-1, 0), y, w+1, s, evalb(x=0))+
`if`(y=0 or i, b(n-1, max(y-1, 0), w, s+1, x, evalb(y=0)), 0)+
`if`(s=0 or i, b(n-1, max(s-1, 0), x, y+1, w, evalb(s=0)), 0)))
end:
a:= n-> `if`(n=0, 1, 4*b(n-1, 0, 0, 1, 0, true)):
seq(a(n), n=0..30);
|
|
MATHEMATICA
|
b[n_, x_, y_, w_, s_, i_] := b[n, x, y, w, s, i] = If[n == 0, 1, If[y > s, b[n, x, s, w, y, i], b[n - 1, Max[x - 1, 0], y, w + 1, s, x == 0] + If[y == 0 || i, b[n - 1, Max[y - 1, 0], w, s + 1, x, y == 0], 0] + If[s == 0 || i, b[n - 1, Max[s - 1, 0], x, y + 1, w, s == 0], 0]]];
a[n_] := If[n == 0, 1, 4*b[n - 1, 0, 0, 1, 0, True]];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,walk
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|