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-7 of 7 results.

A120443 Number of (undirected) Hamiltonian paths in the n X n grid graph.

Original entry on oeis.org

1, 4, 20, 276, 4324, 229348, 13535280, 3023313284, 745416341496, 730044829512632, 786671485270308848, 3452664855804347354220, 16652005717670534681315580, 331809088406733654427925292528, 7263611367960266490262600117251524
Offset: 1

Views

Author

David Bevan, Jul 19 2006

Keywords

Examples

			From _Robert FERREOL_, Apr 03 2019: (Start)
a(3) = 20:
there are 4 paths similar to
  + - + - +
          |
  + - + - +
  |
  + - + - +
8 paths similar to
  + - + - +
  |       |
  +   + - +
  |   |
  +   + - +
and 8 paths similar to
  + - + - +
  |       |
  +   +   +
  |   |   |
  +   + - +
(End)
		

Crossrefs

Formula

a(n) = A096969(n) / 2 for n > 1.

Extensions

More terms from Jesper L. Jacobsen (jesper.jacobsen(AT)u-psud.fr), Dec 12 2007

A000532 Number of Hamiltonian paths from NW to SW corners in an n X n grid.

Original entry on oeis.org

1, 1, 2, 8, 86, 1770, 88418, 8934966, 2087813834, 1013346943033, 1111598871478668, 2568944901392936854, 13251059359839620127088, 145194816279817259193401518, 3524171261632305641165676374930, 182653259988707123426135593460533473
Offset: 1

Views

Author

Russ Cox, Mar 15 1996

Keywords

Comments

Number of walks reaching each cell exactly once.

Crossrefs

Extensions

More terms from Zhao Hui Du, Jul 08 2008
Edited by Franklin T. Adams-Watters, Jul 03 2009
Name clarified by Andrew Howroyd, Apr 10 2016

A121785 "Spanning walks" on the square lattice (see Jensen web site for further information).

Original entry on oeis.org

8, 95, 2320, 154259, 30549774, 17777600753, 30283708455564, 152480475641255213, 2287842813828061810244, 102744826737618542833764649, 13848270995235582268846758977770
Offset: 1

Views

Author

N. J. A. Sloane, Aug 30 2006

Keywords

Comments

Number of Hamiltonian paths in the graph P_{n+1} X P_{n+1} starting at any of the n+1 vertices on one side of the graph and terminating at any of the n+1 vertices on the opposite side. - Andrew Howroyd, Apr 10 2016

Crossrefs

A068381 Number of partitions of n X n checkerboard by two edgewise-connected sets which produce the maximum n^2-2n+2 frontier edges between the two sets.

Original entry on oeis.org

12, 32, 96, 648, 7736, 228424, 11974112, 1599762776, 382467306272, 234367651907856, 258981528765867728, 733498025032488425464, 3770347483688546402804760, 49588653272896250824990166768
Offset: 2

Views

Author

R. H. Hardin, Mar 04 2002

Keywords

Comments

Not divided by 4 because that property may not continue.
Each partition is counted twice in this sequence. The sequence can be computed by counting Hamiltonian paths on a n-1 x n-1 grid that start at any vertex on the grid boundary and terminate at another boundary vertex. Counts for whether the path starts or terminates on a corner or non-corner need to be computed separately as there are different multiplication factors. - Andrew Howroyd, Apr 13 2016

Examples

			Illustration of a(2)=6*2:
    __.__     __.__     __.__    __.__     __.__     __.__
   |__|  |   |  |__|   |   __|  |__   |   |__.__|   |  |  |
   |__.__|   |__.__|   |__|__|  |__|__|   |__.__|   |__|__|
Illustration of relation of a Hamiltonian path in a 3 x 3 grid to solutions of a(4):
                 .__.__.__.__.   .__.__.__.__.   .__.__.__.__.   .__.__.__.__.
   .__.__        |__.__.__.  |   |  |__.__.  |   |__.__.__.  |   |  |__.__.  |
    __.__|  <=>  |  .__.__|  |   |  .__.__|  |   |  .__.__|  |   |  .__.__|  |
   |__.__.       |  |__.__.__|   |  |__.__.__|   |  |__.__.  |   |  |__.__.  |
                 |__.__.__.__|   |__.__.__.__|   |__.__.__|__|   |__.__.__|__|
		

Crossrefs

Extensions

a(7)-a(15) from Andrew Howroyd, Apr 13 2016

A333571 Square array T(n,k), n >= 1, k >= 2, read by antidiagonals, where T(n,k) is the number of Hamiltonian paths in the n X k grid graph which start at any of the n vertices on left side of the graph and terminate at any of the n vertices on the right side.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 8, 6, 1, 2, 16, 14, 10, 1, 2, 32, 34, 38, 14, 1, 2, 64, 80, 162, 74, 20, 1, 2, 128, 190, 650, 426, 170, 26, 1, 2, 256, 450, 2728, 2166, 1594, 338, 34, 1, 2, 512, 1066, 11250, 12014, 12908, 4374, 724, 42, 1, 2, 1024, 2526, 46984, 62714, 119364, 47738, 14640, 1448, 52
Offset: 1

Views

Author

Seiichi Manyama, Mar 27 2020

Keywords

Examples

			Square array T(n,k) begins:
   1,  1,   1,    1,     1,     1,      1, ...
   2,  2,   2,    2,     2,     2,      2, ...
   4,  8,  16,   32,    64,   128,    256, ...
   6, 14,  34,   80,   190,   450,   1066, ...
  10, 38, 162,  650,  2728, 11250,  46984, ...
  14, 74, 426, 2166, 12014, 62714, 340510, ...
		

Crossrefs

Columns k=2-3 give: A333574, A333575.
Rows n=1-3 give: A000012, 2*A000012, A000079.
T(n,n) gives A121789(n-1).
Cf. A333509.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    import graphillion.tutorial as tl
    def A(start, goal, n, k):
        universe = tl.grid(n - 1, k - 1)
        GraphSet.set_universe(universe)
        paths = GraphSet.paths(start, goal, is_hamilton=True)
        return paths.len()
    def A333571(n, k):
        if n == 1: return 1
        s = 0
        for i in range(1, n + 1):
            for j in range(k * n - n + 1, k * n + 1):
                s += A(i, j, k, n)
        return s
    print([A333571(j + 1, i - j + 2) for i in range(11) for j in range(i + 1)])

A328931 Number of Hamiltonian paths in an n X n square, starting from an edge, finishing anywhere, all symmetries excluded.

Original entry on oeis.org

1, 1, 4, 51, 660, 30745, 1621471, 312637285, 72599875346, 60968508324409, 64128000370443037, 240651566540823214362, 1162174738476331286327484, 19776621796151182708398884540, 441809773825445785471324877668710
Offset: 1

Views

Author

David Lawrence, Oct 31 2019

Keywords

Comments

Given an n X n grid, start from any outside edge, enter the grid, and visit every square. 1 X 1 is a trivial example. 2 X 2 can only be traversed clockwise or counterclockwise (therefore considered the same solution). For 3 X 3 with the cells labeled ABC/DEF/GHI, the four solutions are ADEBCFIHG, ADGHIFEBC, ADGHIFCE and ADGHEBCFI. All others are rotations or reflections.
Discovered programmatically by exhaustive recursive search.

Examples

			All distinct paths through a 1 X 1 labyrinth visiting all cells.
  +  +
  |**|
  +--+
.
All distinct paths through a 2 X 2 labyrinth visiting all cells.
  +  +--+
  |  |**|
  +  +  +
  |     |
  +--+--+
.
All distinct paths through a 3 X 3 labyrinth visiting all cells.
  +  +--+--+
  |  |     |
  +  +  +  +
  |     |  |
  +--+--+  +
  |**      |
  +--+--+--+
.
  +  +--+--+
  |  |   **|
  +  +  +--+
  |  |     |
  +  +--+  +
  |        |
  +--+--+--+
.
  +  +--+--+
  |  |     |
  +  +  +  +
  |  |**|  |
  +  +--+  +
  |        |
  +--+--+--+
.
  +  +--+--+
  |  |     |
  +  +  +  +
  |  |  |  |
  +  +  +  +
  |     |**|
  +--+--+--+
		

Crossrefs

Extensions

a(8)-a(15) from Andrew Howroyd, Oct 31 2019

A363577 Number of inequivalent Hamiltonian paths starting in the lower left corner of an n X n grid graph (paths differing only by rotations and reflections are regarded as equivalent).

Original entry on oeis.org

1, 1, 3, 23, 347, 10199, 683227, 85612967, 25777385143, 14396323278040, 19799561204761862, 50351228336401026361, 319210377672595552740369, 3736517399241599771428011100, 109790442395888863208285555153329, 5952238893391106787883489313797219949
Offset: 1

Views

Author

Lars Blomberg, Jun 10 2023

Keywords

Comments

Equivalently, number of inequivalent Hamiltonian paths starting in a corner of an n X n grid graph (paths differing only by rotations and reflections are regarded as equivalent). - Martin Ehrenstein, Jul 08 2023

Examples

			There are 3 paths for n=3:
  +--+--+    +--+--+    +--+  +
  |     |    |     |    |  |  |
  +  +  +    +  +--+    +  +  +
  |  |  |    |  |       |  |  |
  +  +--+    +  +--+    +  +--+
A fourth path:
  +--+--+
        |
  +--+  +
  |  |  |
  +  +--+
is the same as the second one in the row above after a 90-degree rotation.
All paths starting E are the same as the corresponding ones starting N after reflection in the forward diagonal.
		

Crossrefs

Extensions

a(1) added by N. J. A. Sloane, Jun 10 2023
a(8)-a(9) from Martin Ehrenstein, Jul 08 2023
a(10)-a(16) from Oliver R. Bellwood, Jun 06 2025
Showing 1-7 of 7 results.