cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A001334 Number of n-step self-avoiding walks on hexagonal [ =triangular ] lattice.

Original entry on oeis.org

1, 6, 30, 138, 618, 2730, 11946, 51882, 224130, 964134, 4133166, 17668938, 75355206, 320734686, 1362791250, 5781765582, 24497330322, 103673967882, 438296739594, 1851231376374, 7812439620678, 32944292555934, 138825972053046
Offset: 0

Views

Author

Keywords

Comments

The hexagonal lattice is the familiar 2-dimensional lattice in which each point has 6 neighbors. This is sometimes called the triangular lattice.

References

  • A. J. Guttmann, Asymptotic analysis of power-series expansions, pp. 1-234 of C. Domb and J. L. Lebowitz, editors, Phase Transitions and Critical Phenomena. Vol. 13, Academic Press, NY, 1989.
  • B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 459.
  • 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).

Crossrefs

Programs

  • Mathematica
    mo={{2, 0},{-1, 1},{-1, -1},{-2, 0},{1, -1},{1, 1}}; a[0]=1;
    a[tg_, p_:{{0, 0}}] := Block[{e, mv = Complement[Last[p]+# & /@ mo, p]}, If[tg == 1, Length@mv, Sum[a[tg-1, Append[p, e]], {e, mv}]]];
    a /@ Range[0, 6]
    (* Robert FERREOL, Nov 28 2018; after the program of Giovanni Resta in A001411 *)
  • 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=[[2,0],[-1,1],[-1, -1],[-2,0],[1,-1],[1, 1]]
    def a(n,P=[[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(11)]
    # Robert FERREOL, Dec 11 2018

A192871 Number of n-step prudent self-avoiding walks on honeycomb lattice.

Original entry on oeis.org

1, 3, 6, 12, 24, 48, 90, 168, 318, 594, 1092, 2004, 3678, 6720, 12210, 22128, 40074, 72372, 130380, 234432, 421128, 755208, 1352328, 2418246, 4320552, 7709898, 13744764, 24477618, 43560444, 77448330, 137602440, 244277016, 433399824, 768379830, 1361530134
Offset: 0

Views

Author

Alois P. Heinz, Jul 11 2011

Keywords

Comments

A prudent walk never takes a step pointing towards a vertex it has already visited. Prudent walks are self-avoiding but not reversible in general.

Examples

			This 8-step prudent self-avoiding walk on honeycomb lattice from (S) to (E) is not reversible:
.           o...o       o...o
.          .     .     .     .
.     o...o       4---3       o
.    .     .     /     \     .
.   o       6---5       2...o
.    .     /     .     /     .
.     o...7      (S)--1       o
.    .     \     .     .     .
.   o      (E)..o       o...o
.    .     .     .     .
.     o...o       o...0
		

Crossrefs

Programs

  • Maple
    i:= n-> max(n, 0)+1: d:= n-> max(n-1, -1):
    b:= proc(n, x, y, z, u, v, w) option remember;
        `if`(n=0, 1, `if`(x>y, b(n, y, x, w, v, u, z),
        `if`(min(y, z)<=0 or x=-1,
            b(n-1, d(y), d(z), u, i(v), i(w), x), 0)+
        `if`(min(w, x)<=0 or y=-1,
            b(n-1, d(w), d(x), y, i(z), i(u), v), 0)))
        end:
    a:= n-> `if`(n<2, 1 +2*n, 6*b(n-2, -1, -1, 1, 2, 1, -1)):
    seq(a(n), n=0..20);
  • Mathematica
    i[n_] := Max[n, 0] + 1; d[n_] := Max[n - 1, -1];
    b[n_, x_, y_, z_, u_, v_, w_] := b[n, x, y, z, u, v, w] = If[n == 0, 1, If[x > y, b[n, y, x, w, v, u, z], If[Min[y, z] <= 0 || x == -1, b[n - 1, d[y], d[z], u, i[v], i[w], x], 0] + If[Min[w, x] <= 0 || y == -1, b[n - 1, d[w], d[x], y, i[z], i[u], v], 0]]];
    a[n_] := If[n < 2, 1 + 2 n, 6 b[n - 2, -1, -1, 1, 2, 1, -1]];
    a /@ Range[0, 34] (* Jean-François Alcover, Sep 22 2019, after Alois P. Heinz *)
Showing 1-2 of 2 results.