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.

A010566 Number of 2n-step 2-dimensional closed self-avoiding paths on square lattice.

Original entry on oeis.org

0, 8, 24, 112, 560, 2976, 16464, 94016, 549648, 3273040, 19781168, 121020960, 748039552, 4664263744, 29303071680, 185307690240, 1178635456752, 7535046744864, 48392012257184, 312061600211680, 2019822009608592, 13117263660884768, 85447982919036736
Offset: 1

Views

Author

Keywords

Comments

a(n) = 4n*A002931(n). There are (2n) choices for the starting point and 2 choices for the orientation, in order to produce self-avoiding closed paths from a polygon of perimeter 2n. - Philippe Flajolet, Nov 22 2003

References

  • B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 461.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

Cf. A002931.

Programs

  • Mathematica
    A002931 = Cases[Import["https://oeis.org/A002931/b002931.txt", "Table"], {, }][[All, 2]]; a[n_] := 4n A002931[[n]];
    a /@ Range[55] (* Jean-François Alcover, Jan 11 2020 *)
  • Python
    # Alex Nisnevich, Jul 22 2023
    def num_continuations(path, dist):
        (x, y) = path[-1]
        next = [(x+1, y), (x-1, y), (x, y+1), (x, y-1)]
        if dist == 1:
            return (0, 0) in next
        else:
            return sum(num_continuations(path + [c], dist - 1) for c in next if c not in path)
    def A010566(n):
        return 4 * num_continuations([(0, 0), (1, 0)], 2 * n - 1) if n >= 2 else 0