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

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

A288148 Number of (undirected) paths in the n-triangular grid graph.

Original entry on oeis.org

0, 6, 108, 2598, 123750, 12994248, 3114709914, 1730766715308, 2248937669398650, 6877862090075063484, 49790967547432817528562, 857275977287938332061154856, 35233501393224883314185777947590
Offset: 0

Views

Author

Eric W. Weisstein, Jun 05 2017

Keywords

Comments

Paths of length zero are not counted here.

Examples

			a(1) = 6:
:    o    :    o    :    o    :    o    :    o    :    o
:         :   /     :     \   :   / \   :     \   :   /
:  o---o  :  o   o  :  o   o  :  o   o  :  o---o  :  o---o  .
		

Crossrefs

Extensions

a(7)-a(12) from Andrew Howroyd, Jun 07 2017

A174579 Number of spanning trees in the n-triangular grid graph.

Original entry on oeis.org

1, 3, 54, 5292, 2723220, 7242690816, 98719805835000, 6861326937782575104, 2423821818614367091537296, 4342290918217084382837760000000, 39389085041906366256386454778172877408, 1807026244113880332171608161401397806958116864
Offset: 0

Views

Author

Alois P. Heinz, Nov 29 2010

Keywords

Comments

The n-triangular grid graph has n+1 rows with k vertices in row k. Each vertex is connected to the neighbors in the same row and up to two vertices in each of the neighboring rows. The Graph has A000217(n+1) vertices and 3*A000217(n) edges altogether.

Crossrefs

Programs

  • Maple
    with(LinearAlgebra):
    tr:= n-> n*(n+1)/2:
    a:= proc(n) local h, i, M;
          if n=0 then 1 else
            M:= Matrix(tr(n+1), shape=symmetric);
            for h in [seq(seq([[i, i+j], [i, i+j+1], [i+j, i+j+1]][],
                               i=tr(j-1)+1 .. tr(j-1)+j), j=1..n)]
            do M[h[]]:= -1 od;
            for i to tr(n+1) do M[i, i]:= -add(M[i, j], j=1..tr(n+1)) od;
            Determinant(DeleteColumn(DeleteRow(M, 1), 1))
          fi
        end:
    seq(a(n), n=0..12);
  • Mathematica
    tr[n_] := n*(n + 1)/2;
    a[0] = 1; a[n_] := Module[{T, M}, T = Table[Table[{{i, i+j}, {i, i+j+1}, {i + j, i+j+1}}, {i, tr[j-1]+1, tr[j-1] + j}], {j, 1, n}] // Flatten[#, 2]&; M = Array[0&, {tr[n+1], tr[n+1]}]; Do[{i, j} = h; M[[i, j]] = -1, {h, T}]; M = M + Transpose[M]; For[i = 1, i <= tr[n+1], i++, M[[i, i]] = -Sum[M[[i, j]], {j, 1, tr[n+1]}]]; Det[Rest /@ Rest[M]]];
    Table[a[n], {n, 0, 12}] (* Jean-François Alcover, Jun 02 2018, from Maple *)
  • 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 A174579(n):
        if n == 0: return 1
        universe = make_n_triangular_grid_graph(n)
        GraphSet.set_universe(universe)
        spanning_trees = GraphSet.trees(is_spanning=True)
        return spanning_trees.len()
    print([A174579(n) for n in range(8)])  # Seiichi Manyama, Nov 30 2020

Extensions

Indexing changed by Alois P. Heinz, Jun 14 2017

A297671 Number of chordless cycles in the n-triangular grid graph.

Original entry on oeis.org

0, 0, 0, 1, 7, 41, 260, 1930, 17463, 200008, 3026192, 62212319, 1742874972, 65794989216, 3314857545154, 222226981778153, 19858056830333695, 2371636836808937036, 378993965527624639893
Offset: 0

Views

Author

Eric W. Weisstein, Jan 02 2018

Keywords

Crossrefs

Extensions

a(7)-a(18) from Andrew Howroyd, Jan 08 2018

A308144 Number of (undirected) Hamiltonian paths on the triangular grid with n vertices on each side.

Original entry on oeis.org

1, 3, 12, 114, 1968, 66312, 4381020, 578266212, 153350225268, 82409298702462, 90180040305841212, 201800030110625440248, 926548406689594565864346, 8752381854153235620928637604
Offset: 1

Views

Author

Eric W. Weisstein, May 14 2019

Keywords

Crossrefs

Formula

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

Extensions

a(1) corrected by Andrew Howroyd, Jan 19 2022
Showing 1-5 of 5 results.