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

A339190 Square array T(n,k), n >= 2, k >= 2, read by antidiagonals, where T(n,k) is the number of (undirected) Hamiltonian cycles on the n X k king graph.

Original entry on oeis.org

3, 4, 4, 8, 16, 8, 16, 120, 120, 16, 32, 744, 2830, 744, 32, 64, 4922, 50354, 50354, 4922, 64, 128, 31904, 1003218, 2462064, 1003218, 31904, 128, 256, 208118, 19380610, 139472532, 139472532, 19380610, 208118, 256, 512, 1354872, 378005474, 7621612496, 22853860116, 7621612496, 378005474, 1354872, 512
Offset: 2

Views

Author

Seiichi Manyama, Nov 27 2020

Keywords

Examples

			Square array T(n,k) begins:
   3,     4,        8,         16,            32,               64, ...
   4,    16,      120,        744,          4922,            31904, ...
   8,   120,     2830,      50354,       1003218,         19380610, ...
  16,   744,    50354,    2462064,     139472532,       7621612496, ...
  32,  4922,  1003218,  139472532,   22853860116,    3601249330324, ...
  64, 31904, 19380610, 7621612496, 3601249330324, 1622043117414624, ...
		

Crossrefs

Rows and columns 3..5 give A339200, A339201, A339202.
Main diagonal gives A140519.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_nXk_king_graph(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
                if i < k:
                    grids.append((i + (j - 1) * k, i + j * k + 1))
                if i > 1:
                    grids.append((i + (j - 1) * k, i + j * k - 1))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339190(n, k):
        universe = make_nXk_king_graph(n, k)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles(is_hamilton=True)
        return cycles.len()
    print([A339190(j + 2, i - j + 2) for i in range(10 - 1) for j in range(i + 1)])

Formula

T(n,k) = T(k,n).

A339197 Number of (undirected) cycles on the n X 3 king graph.

Original entry on oeis.org

30, 348, 3459, 33145, 316164, 3013590, 28722567, 273751765, 2609096478, 24866992602, 237004387635, 2258860992595, 21528938911842, 205189789087374, 1955639788756293, 18638973217791295, 177645865363829526, 1693121885638023396, 16136945905019298321, 153799336805212613275
Offset: 2

Views

Author

Seiichi Manyama, Nov 27 2020

Keywords

Crossrefs

Column 3 of A339098.
Cf. A339200.

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_nXk_king_graph(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
                if i < k:
                    grids.append((i + (j - 1) * k, i + j * k + 1))
                if i > 1:
                    grids.append((i + (j - 1) * k, i + j * k - 1))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339098(n, k):
        universe = make_nXk_king_graph(n, k)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles()
        return cycles.len()
    def A339197(n):
        return A339098(n, 3)
    print([A339197(n) for n in range(2, 30)])

Formula

Empirical g.f.: -x^2 * (11*x^4 + 49*x^3 + 69*x^2 + 48*x + 30) / ((x-1)^2 * (6*x^4 + 5*x^3 + 14*x^2 + 8*x - 1)). - Vaclav Kotesovec, Dec 09 2020

A339850 Number of Hamiltonian circuits within parallelograms of size 3 X n on the triangular lattice.

Original entry on oeis.org

1, 4, 13, 44, 148, 498, 1676, 5640, 18980, 63872, 214944, 723336, 2434192, 8191616, 27566672, 92768192, 312186304, 1050578720, 3535439040, 11897565568, 40038044736, 134737229824, 453421769728, 1525868548224, 5134898635008, 17280115002368, 58151561641216
Offset: 2

Views

Author

Seiichi Manyama, Dec 19 2020

Keywords

Examples

			a(2) = 1:
      *---*
     /   /
    *   *
   /   /
  *---*
a(3) = 4:
      *   *---*      *---*---*
     / \ /   /        \     /
    *   *   *      *---*   *
   /       /      /       /
  *---*---*      *---*---*
      *---*---*      *---*---*
     /       /      /       /
    *   *   *      *   *---*
   /   / \ /      /     \
  *---*   *      *---*---*
		

Crossrefs

Row 3 of A339849.
Cf. A339200.

Programs

  • Mathematica
    Drop[CoefficientList[Series[(x (1 + x))^2/(1 - 2 x - 4 x^2 - 2 x^3), {x, 0, 28}], x], 2] (* Michael De Vlieger, Jul 06 2021 *)
  • PARI
    my(N=66, x='x+O('x^N)); Vec((x*(1+x))^2/(1-2*x-4*x^2-2*x^3))
    
  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_T_nk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
                if i < k:
                    grids.append((i + (j - 1) * k, i + j * k + 1))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A339849(n, k):
        universe = make_T_nk(n, k)
        GraphSet.set_universe(universe)
        cycles = GraphSet.cycles(is_hamilton=True)
        return cycles.len()
    def A339850(n):
        return A339849(3, n)
    print([A339850(n) for n in range(2, 21)])

Formula

G.f.: (x*(1+x))^2/(1-2*x-4*x^2-2*x^3).
a(n) = 2*a(n-1) + 4*a(n-2) + 2*a(n-3) for n > 4.
Showing 1-3 of 3 results.