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-10 of 17 results. Next

A320421 Number of closed self-avoiding paths on square lattice with 2*n steps, A010566(n)/8.

Original entry on oeis.org

0, 1, 3, 14, 70, 372, 2058, 11752, 68706, 409130, 2472646, 15127620, 93504944, 583032968, 3662883960, 23163461280, 147329432094, 941880843108, 6049001532148, 39007700026460, 252477751201074, 1639657957610596, 10680997864879592, 69772819359471480, 456959583009324200
Offset: 1

Views

Author

Hugo Pfoertner, Jan 08 2019

Keywords

Comments

Rotations and reflections of the path are counted only once, but see A266549 for further elimination of path isomorphisms.

References

Crossrefs

A002931 Number of self-avoiding polygons of length 2n on square lattice (not allowing rotations).

Original entry on oeis.org

0, 1, 2, 7, 28, 124, 588, 2938, 15268, 81826, 449572, 2521270, 14385376, 83290424, 488384528, 2895432660, 17332874364, 104653427012, 636737003384, 3900770002646, 24045500114388, 149059814328236, 928782423033008, 5814401613289290, 36556766640745936
Offset: 1

Views

Author

Keywords

Comments

Translations are allowed, but not rotations or reflections.
a(n) is also the coefficient of n^2 in the sequence of quadratic polynomials giving the numbers of 2k-cycles in the n X n grid graph for n >= k-1 (see the example). - Eric W. Weisstein, Apr 05 2018

Examples

			At length 8 there are 7 polygons, consisting of the 2, 1, 4 resp. rotations of:
._. .___. .___.
| | | . | | ._|
| | |___| |_|
|_|
Let p(k,n) be the number of 2k-cycles in the n X n grid graph for n >= k-1.  p(k,n) are quadratic polynomials in n, with the first few given by:
p(1,n) = 0,
p(2,n) = 1 - 2*n + n^2,
p(3,n) = 4 - 6*n + 2*n^2,
p(4,n) = 26 - 28*n + 7*n^2,
p(5,n) = 164 - 140*n + 28*n^2,
p(6,n) = 1046 - 740*n + 124*n^2,
p(7,n) = 6672 - 4056*n + 588*n^2,
p(8,n) = 42790 - 22904*n + 2938*n^2,
p(9,n) = 275888 - 132344*n + 15268*n^2,
...
The quadratic coefficients give a(n), so the first few are 0, 1, 2, 7, 28, 124, .... - _Eric W. Weisstein_, Apr 05 2018
		

References

  • N. Clisby and I. Jensen: A new transfer-matrix algorithm for exact enumerations: self-avoiding polygons on the square lattice, J. Phys. A: Math. Theor. 45 (2012). Also arXiv:1111.5877, 2011. [Extends sequence to a(65)]
  • I. G. Enting: Generating functions for enumerating self-avoiding rings on the square lattice, J. Phys. A: Math. Gen. 13 (1980). pp. 3713-3722. See Table 2.
  • 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. 461.
  • I. Jensen: A parallel algorithm for the enumeration of self-avoiding polygons on the square lattice, J. Phys. A: Math. Gen. 36 (2003). [Extends sequence to a(55)]
  • I. Jensen and A. J. Guttmann: Self-avoiding polygons on the square lattice, J. Phys. A: Math. Gen. 32 (1999). Also arXiv:cond-mat/9905291. [Extends sequence to a(45)]
  • 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

Cf. A056634, A036638, A036639. Equals A010566(n)/(4n).
Cf. A057730.
Cf. A302335 (constant coefficients in p(k,n)).
Cf. A302336 (linear coefficients in p(k,n)).

Extensions

Updated by N. J. A. Sloane, Mar 18 2021

A266549 Number of 2n-step 2-dimensional closed self-avoiding paths on square lattice, reduced for symmetry, i.e., where rotations and reflections are not counted as distinct.

Original entry on oeis.org

0, 1, 1, 3, 6, 25, 86, 414, 1975, 10479, 56572, 316577, 1800363, 10419605, 61061169, 361978851
Offset: 1

Views

Author

Luca Petrone, Dec 31 2015

Keywords

Comments

Differs from A057730 beginning at n = 8, since that sequence includes polyominoes with holes.

Crossrefs

Apparently lim A002931(n)/a(n) = 8 for increasing n, accounting for (in most cases) 4 rotations times two flips. - Joerg Arndt, Hugo Pfoertner, Jul 09 2018
Cf. A010566, A037245 (open self-avoiding walks), A316194.

Extensions

a(11)-a(16) from Joerg Arndt, Jan 25 2018

A334720 Number of 2-dimensional closed-loop self-avoiding paths on a square lattice where each path consists of steps with incrementing length from 1 to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 8, 24, 0, 0, 40, 112, 0, 0, 1376, 2008, 0, 0, 21720, 60848, 0, 0, 635544, 1517368, 0, 0, 20008456, 46010640, 0, 0, 640819936, 1571759136, 0, 0, 22704325648, 55436103264
Offset: 1

Views

Author

Scott R. Shannon, May 08 2020

Keywords

Comments

This sequence gives the number of closed-loop self avoiding walks on a 2D square lattice where the walk starts with a step length of 1 which then increments by 1 after each step up until the step length is n. No closed-loop path is possible until n = 7.
Like A010566 all possible paths are counted, including those that are equivalent via rotation and reflection.
For n = 8, 15, 20, 24, 27, 32, 35, 39, 44, ... = A380867, the path can be a rectangle. The first two cases are illustrated through the "Images" link from Scott R. Shannon. These numbers correspond to triangular numbers T(n) for which there are n1 > n2 > n3 > n4 >= 0 such that T(n) = 2(A+B) for A = T(n1) - T(n2) = T(n3) - T(n4) and B = T(n2) - T(n3). See A380867 for more. - M. F. Hasler, Mar 14 2025

Examples

			a(1) to a(6) = 0 as no closed-loop is possible.
a(7) = 8 as there is one path which forms a closed loop which can be walked in 8 different ways on a 2D square lattice. The path is:
.
             5
   *---.---.---.---.---*
   |                   |
   .                   .
   |                   |
   .                   .  4
   |                   |
6  .                   .
   |                   |     3
   .                   *---.---.---*
   |                               |
   .                               . 2
   |                               |
   *---.---.---.---.---.---.---X---*
                 7               1
.
See the attached link for text images of the closed loops for other n values.
		

Crossrefs

A001413 Number of 2n-step self-avoiding cycles on the cubic lattice.

Original entry on oeis.org

0, 24, 264, 3312, 48240, 762096, 12673920, 218904768, 3891176352, 70742410800, 1309643747808, 24609869536800, 468270744898944, 9005391024862848, 174776445357365040, 3419171337633496704
Offset: 1

Views

Author

Keywords

Comments

Original name: Number of 2n-step polygons on the cubic lattice. "Polygons" suggests translation invariance, and/or independence of the starting point; those are counted in A001409. Here, two paths which start and end at the origin are counted as distinct if they have a different sequence of steps, even if their set of edges is the same modulo translations.
a(n) is the number of 2n-step closed self-avoiding paths on the cubic lattice. - Bert Dobbelaere, Jan 04 2019

References

  • 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).

Crossrefs

Cf. A001409.
Cf. A010566 (for square lattice equivalent).
Cf. A002896 (without self-avoidance restriction).

Programs

  • Python
    def A001413(n): # For illustration; becomes slow for n >= 5.
        if not hasattr(A:=A001413, 'terms'): A.terms=[]; A.paths=((0,0,0),),
        while n > len(A.terms):
            for L in (0,1):
                new = []; cycles = 0
                for path in A.paths:
                    end = path[-1]
                    for i in (0,1,2):
                       for s in (1,-1):
                          t = tuple(end[j]if j!=i else end[j]+s for j in (0,1,2))
                          if t not in path: new.append(path+(t,))
                          elif L and t==path[0]: cycles += 1
                A.paths = new
            A.terms.append(cycles)
        return A.terms[n-1] if n > 1 else 0 # M. F. Hasler, Jun 17 2025

Formula

a(n) = 4*n*A001409(n). - Sean A. Irvine, Jul 27 2020

Extensions

a(11)-a(12) from Bert Dobbelaere, Jan 04 2019
a(13)-a(16) (using A001409) from Alois P. Heinz, Feb 28 2024
Name changed by M. F. Hasler, Jun 17 2025

A334756 Irregular table read by rows: T(n,k) is the number of 2n-step closed self-avoiding paths on a 2D square lattice with area k, where k >= n-1.

Original entry on oeis.org

0, 8, 24, 96, 16, 360, 160, 40, 1320, 960, 528, 144, 24, 4872, 4704, 3752, 2016, 840, 224, 56, 18112, 21632, 20992, 15424, 9920, 4832, 2176, 704, 192, 32, 67248, 96192, 107712, 93312, 75096, 50112, 31104, 16416, 7848, 3168, 1080, 288, 72
Offset: 1

Views

Author

Scott R. Shannon, May 10 2020

Keywords

Comments

See A010566 for the number of closed self-avoiding 2D square lattice paths. Like that sequence here all possible paths are counted when determining the polygon areas, including those that are equivalent via rotation and reflection.

Examples

			For n = 2, total steps = 4, there are 8 different paths with an area of 1. These are the 8 possible ways to walk the polygon:
+---+
|   |
+---+
.
For n = 3, total steps = 6, there are 24 different paths with an area of 2. These are the 24 possible ways to walk the polygon:
+---+---+
|       |
+---+---+
.
For n = 4, total steps = 8, there are 96 different paths with an area of 3 and 16 different paths with an area of 4. These are the possible ways to walk the polygons:
+---+                      +---+---+
|   |                      |       |
+   +---+                  +       +
|       |                  |       |
+---+---+  for area = 3    +---+---+ for area = 4
.
For n = 5, total steps = 10, there are 360 different paths with an area of 4, 160 paths with an area of 5 and 40 different paths with an area of 6. These are the possible ways to walk the polygons:
+---+---+---+---+    +---+               +---+           +---+---+
|               |    |   |               |   |           |       |
+---+---+---+---+    +   +---+---+   +---+   +---+   +---+   +---+
                     |           |   |           |   |       |
                     +---+---+---+   +---+---+---+   +---+---+      for area = 4
.
+---+---+                      +---+---+---+
|       |                      |           |
+       +---+                  +           +
|           |                  |           |
+---+---+---+  for area = 5    +---+---+---+  for area = 6
.
Table begins:
0;
8;
24;
96,16;
360,160,40;
1320,960,528,144,24;
4872,4704,3752,2016,840,224,56;
18112,21632,20992,15424,9920,4832,2176,704,192,32;
67248,96192,107712,93312,75096,50112,31104,16416,7848,3168,1080,288,72;
249480,415040,526400,514480,468680,373280,281280,189920,120400,69120,36560,17040,7480,2720,880,240,40;
Row sums = A010566.
		

Crossrefs

Formula

T(n, k) = 4 * n * A008855(k, n). - Andrey Zabolotskiy, Sep 27 2024

A335305 Number of 2-dimensional closed-loop self-avoiding paths on a square lattice where each path consists of steps of length 1 to n which can be taken in any order.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 16128, 287232, 0, 0, 1843367680, 45589291776, 0, 0
Offset: 1

Views

Author

Scott R. Shannon, May 31 2020

Keywords

Comments

This sequence gives the number of closed-loop self avoiding walks on a 2D square lattice where the walk consists of steps of length 1 to n which can be taken in any order. No closed-loop path is possible until n = 7.
As in A334720 the only n values which can form closed loops are those which correspond to even triangular numbers; any path must take the same number of steps back toward the origin as it does away from the origin in each of the four possible directions to form a closed loop, so the total sum of the steps in these directions must be even. As the walks consist of the steps of length 1 to n this implies only walks for which the sum of 1 to n is even can form closed loops.
Like A010566 all possible paths are counted, including those that are equivalent via rotation and reflection. Also counted as different walks are loops which visit identical lattice points but are done so by taking steps in a different order. This leads to an extremely rapid increase in the total number of loops possible as n increases.
a(15) is currently unknown but is likely to be about 6*10^15.

Examples

			a(1) to a(6) = 0 as no closed loop paths are possible.
a(7) = 16128. Given the first step has length 1 and is to the right, with the next non-right step being upward, there are 84 different loops. Each of these can be walked in at least 2 ways, with the single perfect square having 48 different possible walks. Each of these in turn can be started with a first step of length 1 to n, and each of these can then be walked in 8 different ways on a 2D square grid. This gives a total number of 7-step paths of 16128. This should be compared with A334720 where for n=7 only 8 paths are possible. See the attached link text file for more details of n=7.
		

Crossrefs

A010567 Number of 2n-step self-avoiding closed paths (or cycles) on the 3-dimensional cubic lattice.

Original entry on oeis.org

6, 24, 264, 3312, 48240, 762096, 12673920, 218904768, 3891176352, 70742410800, 1309643747808, 24609869536800, 468270744898944, 9005391024862848, 174776445357365040, 3419171337633496704
Offset: 1

Views

Author

Keywords

Comments

This sequence agrees with A001413 except for n=1, for which the given value is "purely conventional" (although the convention is non-standard): it counts 6 two-step closed paths, all of which visit no node twice but use an edge twice, so whether they are "self-avoiding" is indeed a matter of agreement. Same considerations apply to the first terms of A010568-A010570. - Andrey Zabolotskiy, May 29 2018

Crossrefs

Essentially the same as A001413.
Cf. A010568 (analog in 4 dimensions), A010569 (in 5D), A010570 (in 6D), A130706 (in 1D), A010566 (in 2D, different convention for n=1), A002896 (closed walks, not necessarily self-avoiding), A001412 (self-avoiding walks, not necessarily closed), A039618, A038515.

Programs

  • Python
    def A010567(n): # For illustration - becomes slow for n > 5
        if not hasattr(A:=A010567, 'terms'):
            A.terms=[6]; O=0,; A.paths=[(O*3, (1,)+O*2, t+O)for t in((2,0),(1,1))]
        while n > len(A.terms):
            for L in (0,1):
                new = []; cycles = 0
                for path in A.paths:
                    end = path[-1]
                    for i in (0,1,2):
                       for s in (1,-1):
                          t = tuple(end[j]if j!=i else end[j]+s for j in (0,1,2))
                          if t not in path: new.append(path+(t,))
                          elif L and t==path[0]: cycles += 24 if path[2][1] else 6
                A.paths = new
            A.terms.append(cycles)
        return A.terms[n-1] # M. F. Hasler, Jun 17 2025

Extensions

a(8)-a(10) copied from A001413 by Andrey Zabolotskiy, May 29 2018
a(11)-a(12) copied from A001413 by Pontus von Brömssen, Feb 28 2024
a(13)-a(16) (using A001413) from Alois P. Heinz, Feb 28 2024
Name edited and "self-avoiding" added by M. F. Hasler, Jun 17 2025

A010568 Number of 2n-step self-avoiding closed paths on the 4-dimensional cubic lattice.

Original entry on oeis.org

8, 48, 912, 22944, 652320, 20266368, 669756192, 23146172544, 827460518688, 30378237727200, 1139447186954208, 43501453488658368, 1685588678025512832
Offset: 1

Views

Author

Keywords

Comments

From M. F. Hasler, Jun 18 2025: (Start)
This sequence gives the number of self-avoiding paths starting and ending at the origin. It does not consider equivalence with respect to translations, rotations or reflections. So it does count multiple cycles whose set of edges represents the same polygon. For example, a(2) = 48 counts 4-step cycles which all correspond to a unit square.
This explains why 8n | a(n) for all n, and a(n)/8n = (1, 3, 38, 717, 16308, 422216, 11959932, 361658946, 11492507204, 379727971590, ...)
Also, a(n = 1) = 8 gives the 2-step cycles which correspond to one step in any of the 8 directions, and one step back. Although this path is self-avoiding since it does not cross any point multiple times, it uses the same edge for the first and second step, and therefore might be excluded from the counting. In three dimensions this is done in A001413, A001413(1) = 0, as opposed to A010567(1) = 6. For two dimensions, this alternate definition is also used in A010566(1) = 0.
(End)

Crossrefs

Cf. A010566, A010567, A010569, A010570 (similar for dimension 2 through 6).

Programs

  • Python
    def A010568(n): # For illustration - becomes slow for n > 5
        if not hasattr(A:=A010568, 'r'):
           A.terms = [8]; O = 0,; I = O*4, (1,*O*3)
           A.paths = (*I, (2,*O*3)), (*I, (1,1,0,0))
        while n > len(A.terms):
            for L in (0, 1):
                new=[]; cycles = 0; O=(0,)*4; I = 0,1,2,3
                for path in A.paths:
                    end = path[-1]; weight = 48 if path[2][1] else 8
                    for i in I:
                       for s in (1, -1):
                          t = tuple(end[j]if j!=i else end[j]+s for j in I)
                          if t not in path: new.append(path+(t,))
                          elif L and t==O: cycles += weight
                A.paths = new
            A.terms.append(cycles)
        return A.terms[n-1] # M. F. Hasler, Jun 17 2025

Formula

For all n, a(n) is divisible by 8*n. - M. F. Hasler, Jun 18 2025

Extensions

a(6)-a(8) from Sean A. Irvine, May 31 2018
a(9)-a(10) from Sean A. Irvine, Aug 09 2020
"Self-avoiding" inserted in definition by M. F. Hasler, Jun 18 2025
a(11)-a(13) from Clisby et al.'s data added by Andrei Zabolotskii, Jun 25 2025

A337550 Number of closed-loop self-avoiding paths of length 4n on a 2D square lattice where no step can be in the same direction as the previous step.

Original entry on oeis.org

8, 0, 24, 64, 360, 1728, 8624, 43776, 225216, 1173280, 6182704, 32905536, 176657000, 955629920, 5204178360, 28509374976, 157005901896, 868756900608, 4827586102216, 26929911745600, 150750954809952, 846588050093632, 4768197762850608
Offset: 1

Views

Author

Scott R. Shannon, Aug 31 2020

Keywords

Comments

See A337353 for the corresponding number of walks.
Only walks with a length of 4n (except for n=2) can create closed loops.
From Pontus von Brömssen, May 06 2025: (Start)
A006782 counts the walks up to starting point and direction of the walk.
A156228 counts the walks up to rotations, reflections, starting point, and direction of the walk.
(End)

Examples

			a(1) = 8. The single walk of length 4 is:
.
+---+
|   |
+---+
.
This can be taken in 8 different ways on a square lattice, giving a total 1*8 = 8.
a(2) = 0 as there is no closed-loop path consisting of 8 steps.
a(3) = 24. There is one walk, ignoring reflection and rotations, with a length of 12. The walk is:
.
    +---+
    |   |
+---+   +---+
|           |
+---+   +---+
    |   |
    +---+
.
This can be walked in 3 different ways if the first steps are right and then upward. This path can be then taken in 8 ways on a square lattice, giving a total number of 3*8 = 24.
a(4) = 64. There is one walk, with indistinct reflections and rotations, with a length of 16. The walk is:
.
        +---+
        |   |
    +---+   +---+
    |           |
+---+       +---+
|           |
+---+   +---+
    |   |
    +---+
.
This can be walked in 8 different ways if the first steps are right and then upward. This path can be then taken in 8 ways on a square lattice, giving a total number of 8*8 = 64.
.
a(5) = 360. There are four walks, with indistinct reflections and rotations, with a length of 20. The walks, and the different ways they can be taken, are:
.
            +---+              +---+
            |   |              |   |
        +---+   +---+      +---+   +---+
        |           |      |           |
    +---+       +---+      +---+       +---+
    |           |              |           |
+---+       +---+          +---+       +---+
|           |              |           |
+---+   +---+              +---+   +---+
    |   |     x 10             |   |     x 20
    +---+                      +---+
        +---+                  +---+
        |   |                  |   |
    +---+   +---+          +---+   +---+
    |           |          |           |
+---+           +---+      +---+   +---+
|                   |          |   |
+---+           +---+      +---+   +---+
    |           |          |           |
    +---+   +---+          +---+   +---+
        |   |    x 5           |   |     x 10
        +---+                  +---+
.
Each of these can be walked in 8 different ways on a square lattice, giving a total number of 8*(10+20+5+10) = 360.
See the attached text file for images of the closed-loops for n=1 to n=11.
		

Crossrefs

Formula

a(n) = 8*n*A006782(n). - Pontus von Brömssen, May 06 2025

Extensions

a(18)-a(19) from Bert Dobbelaere, Sep 09 2020
a(20)-a(23) (using A006782 data) from Pontus von Brömssen, May 06 2025
Showing 1-10 of 17 results. Next