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.

A112676 Number of (undirected) Hamiltonian cycles on a triangular grid, n vertices on each side.

Original entry on oeis.org

1, 1, 1, 3, 26, 474, 17214, 1371454, 231924780, 82367152914, 61718801166402, 97482824713311442, 323896536556067453466, 2262929852279448821099932, 33231590982432936619392054662, 1025257090790362187626154669771934, 66429726878393651076826663971376589034
Offset: 1

Views

Author

Gareth McCaughan, Dec 30 2005

Keywords

Comments

This sequence counts cycles in a triangular region of the familiar 2-dimensional lattice in which each point has 6 neighbors (sometimes called either the "triangular" or the "hexagonal" lattice), visiting every vertex of the region exactly once and returning to the starting vertex. Cycles differing only in orientation or starting point are not considered distinct.

Examples

			a(3) = 1, the only Hamiltonian cycle being the obvious one running around the edge of the triangle.
		

Crossrefs

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_n_triangular_grid_graph(n):
        s = 1
        grids = []
        for i in range(n + 1, 1, -1):
            for j in range(i - 1):
                a, b, c = s + j, s + j + 1, s + i + j
                grids.extend([(a, b), (a, c), (b, c)])
            s += i
        return grids
    def A112676(n):
        if n == 1: return 1
        universe = make_n_triangular_grid_graph(n - 1)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles(is_hamilton=True)
        return cycles.len()
    print([A112676(n) for n in range(1, 12)])  # Seiichi Manyama, Nov 30 2020

Formula

For n>1, a(n) = A174589(n)/2.

Extensions

a(11)-a(16) from Andrew Howroyd, Nov 03 2015
a(17) from Pettersson by Andrey Zabolotskiy, May 23 2017