|
|
A001412
|
|
Number of n-step self-avoiding walks on cubic lattice.
(Formerly M4202 N1754)
|
|
51
|
|
|
1, 6, 30, 150, 726, 3534, 16926, 81390, 387966, 1853886, 8809878, 41934150, 198842742, 943974510, 4468911678, 21175146054, 100121875974, 473730252102, 2237723684094, 10576033219614, 49917327838734, 235710090502158, 1111781983442406, 5245988215191414, 24730180885580790, 116618841700433358, 549493796867100942, 2589874864863200574, 12198184788179866902, 57466913094951837030, 270569905525454674614
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
REFERENCES
|
Steven R. Finch, Mathematical Constants, Cambridge, 2003, section 5.10, pp. 331-339.
B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 462.
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
|
|
MATHEMATICA
|
mo = {{1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0}, {0, 0, 1}, {0, 0, -1}}; a[0] = 1;
a[tg_, p_: {{0, 0, 0}}] := Block[{e, mv = Complement[Last[p] + # & /@ mo, p]},
If[tg == 1, Return[Length@mv], Sum[a[tg - 1, Append[p, e]], {e, mv}]]];
a /@ Range[0, 8]
|
|
PROG
|
(Python)
def add(L, x):
M=[y for y in L]; M.append(x)
return(M)
plus=lambda L, M : [x+y for x, y in zip(L, M)]
mo=[[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]]
def a(n, P=[[0, 0, 0]]):
if n==0: return(1)
mv1 = [plus(P[-1], x) for x in mo]
mv2=[x for x in mv1 if x not in P]
if n==1: return(len(mv2))
else: return(sum(a(n-1, add(P, x)) for x in mv2))
[a(n) for n in range(8)]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,walk,nice
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|