OFFSET
2,1
LINKS
Seiichi Manyama, Antidiagonals n = 2..12, flattened
Eric Weisstein's World of Mathematics, Hamiltonian Cycle
Eric Weisstein's World of Mathematics, King Graph
FORMULA
T(n,k) = T(k,n).
EXAMPLE
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, ...
PROG
(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)])
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Seiichi Manyama, Nov 27 2020
STATUS
approved