A333580
Square array T(n,k), n >= 1, k >= 1, read by antidiagonals, where T(n,k) is the number of Hamiltonian paths in an n X k grid starting at the lower left corner and finishing in the upper right corner.
Original entry on oeis.org
1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 2, 0, 1, 1, 1, 4, 4, 1, 1, 1, 0, 8, 0, 8, 0, 1, 1, 1, 16, 20, 20, 16, 1, 1, 1, 0, 32, 0, 104, 0, 32, 0, 1, 1, 1, 64, 111, 378, 378, 111, 64, 1, 1, 1, 0, 128, 0, 1670, 0, 1670, 0, 128, 0, 1, 1, 1, 256, 624, 6706, 10204, 10204, 6706, 624, 256, 1, 1
Offset: 1
Square array T(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, ...
1, 0, 1, 0, 1, 0, 1, 0, ...
1, 1, 2, 4, 8, 16, 32, 64, ...
1, 0, 4, 0, 20, 0, 111, 0, ...
1, 1, 8, 20, 104, 378, 1670, 6706, ...
1, 0, 16, 0, 378, 0, 10204, 0, ...
1, 1, 32, 111, 1670, 10204, 111712, 851073, ...
1, 0, 64, 0, 6706, 0, 851073, 0, ...
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333580(n, k):
if n == 1 or k == 1: return 1
universe = tl.grid(n - 1, k - 1)
GraphSet.set_universe(universe)
start, goal = 1, k * n
paths = GraphSet.paths(start, goal, is_hamilton=True)
return paths.len()
print([A333580(j + 1, i - j + 1) for i in range(12) for j in range(i + 1)])
A333863
Number of Hamiltonian paths in a 2*(2*n+1) X (2*n+1) grid starting at the upper left corner and finishing in the lower right corner.
Original entry on oeis.org
1, 16, 117204, 440051896440, 825830699757513748579, 769203260676279544212492116449800, 354179806054404909542325896762875458037457353029, 80433401895946253522491939742836167238530417144721958187080077425
Offset: 0
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333863(n):
universe = tl.grid(4 * n + 1, 2 * n)
GraphSet.set_universe(universe)
start, goal = 1, 2 * (2 * n + 1) ** 2
paths = GraphSet.paths(start, goal, is_hamilton=True)
return paths.len()
print([A333863(n) for n in range(7)])
More terms from
Ed Wynn, Jun 28 2023
A333606
Number of directed Hamiltonian walks from NW to SW corners of a 10 X n grid.
Original entry on oeis.org
1, 1, 256, 1480, 117852, 1513468, 71154709, 1283569420, 47001928863, 1013346943033, 32440676063382, 771708613086275, 22928865477892898, 576390471202016758, 16424125813587374688, 425923820730159849603, 11854446538789342310672, 312866945593394069370317
Offset: 1
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A271592(n, k):
if k == 1: return 1
universe = tl.grid(k - 1, n - 1)
GraphSet.set_universe(universe)
start, goal = 1, n
paths = GraphSet.paths(start, goal, is_hamilton=True)
return paths.len()
def A333606(n):
return A271592(10, n)
print([A333606(n) for n in range(1, 8)])
More terms from
Ed Wynn, Jun 28 2023
Showing 1-3 of 3 results.