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.

A339849 Square array T(n,k), n >= 2, k >= 2, read by antidiagonals, where T(n,k) is the number of Hamiltonian circuits within parallelograms of size n X k on the triangular lattice.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 13, 13, 1, 1, 44, 80, 44, 1, 1, 148, 549, 549, 148, 1, 1, 498, 3851, 7104, 3851, 498, 1, 1, 1676, 26499, 104100, 104100, 26499, 1676, 1, 1, 5640, 183521, 1475286, 3292184, 1475286, 183521, 5640, 1, 1, 18980, 1269684, 20842802, 100766213, 100766213, 20842802, 1269684, 18980, 1
Offset: 2

Views

Author

Seiichi Manyama, Dec 19 2020

Keywords

Examples

			Square array T(n,k) begins:
  1,   1,     1,       1,         1,          1, ...
  1,   4,    13,      44,       148,        498, ...
  1,  13,    80,     549,      3851,      26499, ...
  1,  44,   549,    7104,    104100,    1475286, ...
  1, 148,  3851,  104100,   3292184,  100766213, ...
  1, 498, 26499, 1475286, 100766213, 6523266332, ...
		

Crossrefs

Rows and columns 3..10 give A339850, A339851, A339852, A338970, A339622, A339960, A339961, A339962.
Main diagonal gives A339854.
Cf. A339190.

Programs

  • 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()
    print([A339849(j + 2, i - j + 2) for i in range(11 - 1) for j in range(i + 1)])

Formula

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

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

Original entry on oeis.org

7, 30, 30, 85, 348, 85, 204, 3459, 3459, 204, 451, 33145, 136597, 33145, 451, 954, 316164, 4847163, 4847163, 316164, 954, 1969, 3013590, 171903334, 545217435, 171903334, 3013590, 1969, 4008, 28722567, 6109759868, 61575093671, 61575093671, 6109759868, 28722567, 4008
Offset: 2

Views

Author

Seiichi Manyama, Nov 27 2020

Keywords

Examples

			Square array T(n,k) begins:
    7,     30,        85,         204,            451, ...
   30,    348,      3459,       33145,         316164, ...
   85,   3459,    136597,     4847163,      171903334, ...
  204,  33145,   4847163,   545217435,    61575093671, ...
  451, 316164, 171903334, 61575093671, 21964731190911, ...
		

Crossrefs

Rows and columns 2..5 give A339196, A339197, A339198, A339199.
Main diagonal gives A234622.

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()
    print([A339098(j + 2, i - j + 2) for i in range(9 - 1) for j in range(i + 1)])

Formula

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

A350729 Array read by antidiagonals: T(m,n) is the number of (undirected) Hamiltonian paths in the m X n king graph.

Original entry on oeis.org

1, 1, 1, 1, 12, 1, 1, 48, 48, 1, 1, 208, 392, 208, 1, 1, 768, 4678, 4678, 768, 1, 1, 2752, 43676, 171592, 43676, 2752, 1, 1, 9472, 406396, 4743130, 4743130, 406396, 9472, 1, 1, 32000, 3568906, 132202038, 364618672, 132202038, 3568906, 32000, 1
Offset: 1

Views

Author

Andrew Howroyd, Jan 16 2022

Keywords

Examples

			Array begins:
===========================================================
m\n | 1    2      3         4           5             6 ...
----+------------------------------------------------------
  1 | 1    1      1         1           1             1 ...
  2 | 1   12     48       208         768          2752 ...
  3 | 1   48    392      4678       43676        406396 ...
  4 | 1  208   4678    171592     4743130     132202038 ...
  5 | 1  768  43676   4743130   364618672   28808442502 ...
  6 | 1 2752 406396 132202038 28808442502 6544911081900 ...
     ...
		

Crossrefs

Main diagonal is A308129.

Formula

T(m,n) = T(n,m).

A339201 Number of (undirected) Hamiltonian cycles on the n X 4 king graph.

Original entry on oeis.org

8, 120, 2830, 50354, 1003218, 19380610, 378005474, 7348400816, 143013145124, 2782280184314, 54134923232608, 1053263634537410, 20492847566047336, 398717839924458408, 7757640305938339162, 150936198726479633524, 2936684182444832427774, 57137476790772843457886
Offset: 2

Views

Author

Seiichi Manyama, Nov 27 2020

Keywords

Crossrefs

Column 4 of A339190.
Cf. A339198.

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()
    def A339201(n):
        return A339190(n, 4)
    print([A339201(n) for n in range(2, 20)])

Formula

Empirical g.f.: 2*x^2 * (56*x^16 + 53*x^15 + 413*x^14 - 943*x^13 - 635*x^12 - 700*x^11 + 2283*x^10 + 455*x^9 + 3044*x^8 - 4856*x^7 - 4293*x^6 + 6475*x^5 + 719*x^4 - 1386*x^3 + 143*x^2 - 8*x + 4) / (112*x^16 + 106*x^15 + 964*x^14 - 1933*x^13 + 357*x^12 - 3503*x^11 + 3756*x^10 - 828*x^9 + 12662*x^8 - 18201*x^7 - 2441*x^6 + 5486*x^5 - 704*x^4 + 318*x^3 - 63*x^2 - 17*x + 1). - Vaclav Kotesovec, Dec 09 2020

A339202 Number of (undirected) Hamiltonian cycles on the n X 5 king graph.

Original entry on oeis.org

16, 744, 50354, 2462064, 139472532, 7621612496, 420570135944, 23122750594160, 1272913614363472, 70046421764651488, 3855022666171830728, 212153410644220498768, 11675594777180367650512, 642548778638303396036528, 35361754611803652243506632, 1946082778374581215370587632
Offset: 2

Views

Author

Seiichi Manyama, Nov 27 2020

Keywords

Crossrefs

Column 5 of A339190.
Cf. A339199.

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()
    def A339202(n):
        return A339190(n, 5)
    print([A339202(n) for n in range(2, 20)])

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

Original entry on oeis.org

4, 16, 120, 744, 4922, 31904, 208118, 1354872, 8826022, 57483536, 374412158, 2438639080, 15883563110, 103454037120, 673825180718, 4388811619032, 28585557862518, 186185731404016, 1212679737590398, 7898522254036168, 51445284278407878, 335077523213321312, 2182453613487235150, 14214930709900240312
Offset: 2

Views

Author

Seiichi Manyama, Nov 27 2020

Keywords

Crossrefs

Column 3 of A339190.
Cf. A339197.

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()
    def A339200(n):
        return A339190(n, 3)
    print([A339200(n) for n in range(2, 20)])

Formula

Empirical g.f.: 2*x^2 * (3*x^4 + 4*x^3 + 2*x^2 - 2) / (6*x^4 + 8*x^3 + 15*x^2 + 4*x - 1). - Vaclav Kotesovec, Dec 09 2020

A383153 Square array read by antidiagonals: A(m,n) is the number of 2m-by-2n fers-wazir tours.

Original entry on oeis.org

2, 1, 1, 1, 2, 1, 1, 4, 4, 1, 1, 9, 22, 9, 1, 1, 23, 124, 124, 23, 1, 1, 62, 818, 1620, 818, 62, 1, 1, 170, 6004, 25111, 25111, 6004, 170, 1, 1, 469, 46488, 455219, 882130, 455219, 46488, 469, 1, 1, 1297, 367880, 9103712, 36979379, 36979379, 9103712, 367880, 1297, 1
Offset: 1

Views

Author

Don Knuth, Apr 18 2025

Keywords

Comments

The simplest fairy chess pieces, going back to 9th-century Persia, are the fers -- a (1,1) leaper -- and the wazir -- a (1,0) leaper. (A king combines the moves of a fers and a wazir.) A fers-wazir tour visits every cell of a board exactly once, making fers and wazir moves alternately, and returns to the starting cell.
Such tours exist only when the number of rows is even and the number of columns is even.
For fixed m, these tours can be enumerated with the transfer-matrix method, so the numbers A(m,n) satisfy a linear recurrence.

Examples

			Array begins: (example extended by _Filip Stappers_, Apr 21 2025)
  2,   1,    1,     1,      1,        1,       1,      1,    1,    1,    1,     1, ...
  1,   2,    4,     9,     23,       62,     170,    469, 1297, 3590, 9940, 27525, ...
  1,   4,   22,   124,    818,     6004,   46448, 367880, ...
  1,   9,  124,  1620,  25111,   455219, 9103712, ...
  1,  23,  818, 25111, 882130, 36979379, ...
  1,  62, 6004, ...
  1, 170, ...
  1, ...
  ...
For m = 2 and n = 3, the A(2,3) = 4 solutions are the following 4-by-6 tours (a to b to ... to x):
.
  a-x e-d i-h   a w-v p-q s   a w-v s-r p   a w-v d-e g
   X   X   X    |X   X   X|   |X   X   X|   |X   X   X|
  w b-c f-g j   x b o u-t r   x b t-u o q   x b-c u h f
  |         |     | |           |     |           | |
  v s-r o-n k   e c n h-i k   e c i-h n l   q o-n t i k
   X   X   X    |X   X   X|   |X   X   X|   |X   X   X|
  t-u p-q l-m   d f-g m-l j   d f-g j-k m   p r-s m-l j
		

References

  • D. E. Knuth, Hamiltonian paths and cycles, Section 7.2.2.4 of The Art of Computer Programming (to appear).

Crossrefs

Cf. A383154 (the diagonal A(n,n)).
Cf. A339190 (the analog for king tours).

Formula

G.f. of column 2: z*(1 - 2*z - z^3)/((1 - z)*(1 - 3*z + z^2 - z^3)). - Filip Stappers, Apr 21 2025
Showing 1-7 of 7 results.