|
|
A347947
|
|
Number of walks on square lattice from (1,n) to (0,0) using steps that decrease the Euclidean distance to the origin and increase the Euclidean distance to (n,1) and that change each coordinate by at most 1.
|
|
2
|
|
|
1, 3, 5, 24, 81, 298, 1070, 3868, 13960, 50417, 182084, 657707, 2375894, 8583264, 31009890, 112038032, 404803299, 1462624643, 5284813128, 19095564020, 68998567080, 249316670981, 900876831495, 3255230444720, 11762504284218, 42502963168784, 153581776819904
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Lattice points may have negative coordinates, and different walks may differ in length. All walks are self-avoiding.
|
|
LINKS
|
|
|
MAPLE
|
s:= proc(n) option remember;
`if`(n=0, [[]], map(x-> seq([x[], i], i=-1..1), s(n-1)))
end:
b:= proc(l, v) option remember; (n-> `if`(l=[0$n], 1, add((h-> `if`(
add(i^2, i=h)<add(i^2, i=l) and add(i^2, i=v-h)>add(i^2, i=v-l)
, b(h, v), 0))(l+x), x=s(n))))(nops(l))
end:
a:= n-> b([n, 1]$2):
seq(a(n), n=0..30);
|
|
MATHEMATICA
|
s[n_] := s[n] = If[n == 0, {{}}, Sequence @@
Table[Append[#, i], {i, -1, 1}]& /@ s[n-1]];
b[l_, v_] := b[l, v] = With[{n = Length[l]},
If[l == Table[0, {n}], 1, Sum[With[{h = l + x},
If[h.h<l.l && (v-h).(v-h)>(v-l).(v-l), b[h, v], 0]], {x, s[n]}]]];
a[n_] := b[{n, 1}, {n, 1}];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,walk
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|