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
A333520
Triangle read by rows: T(n,k) is the number of self-avoiding paths of length 2*(n-1+k) connecting opposite corners in the n X n grid graph (0 <= k <= floor((n-1)^2/2), n >= 1).
Original entry on oeis.org
1, 2, 6, 4, 2, 20, 36, 48, 48, 32, 70, 224, 510, 956, 1586, 2224, 2106, 732, 104, 252, 1200, 3904, 10560, 25828, 58712, 121868, 217436, 300380, 280776, 170384, 61336, 10180, 924, 5940, 25186, 88084, 277706, 821480, 2309402, 6140040, 15130410, 33339900, 62692432, 96096244, 116826664, 110195700, 78154858, 39287872, 12396758, 1879252, 111712
Offset: 1
T(3,1) = 4;
S--* S--*--* S *--* S
| | | | | |
*--* *--* *--* * * *--*
| | | | | |
*--*--E *--E E *--* E
Triangle starts:
=======================================================
n\k| 0 1 2 3 4 ... 8 ... 12
---|---------------------------------------------------
1 | 1;
2 | 2;
3 | 6, 4, 2;
4 | 20, 36, 48, 48, 32;
5 | 70, 224, 510, 956, 1586, ... , 104;
6 | 252, 1200, 3904, 10560, ................. , 10180;
T(n,floor((n-1)^2/2)) gives
A121788(n-1).
T(2*n-1,2*(n-1)^2) gives
A001184(n-1).
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333520(n):
if n == 1: return [1]
universe = tl.grid(n - 1, n - 1)
GraphSet.set_universe(universe)
start, goal = 1, n * n
paths = GraphSet.paths(start, goal)
return [paths.len(2 * (n - 1 + k)).len() for k in range((n - 1) ** 2 // 2 + 1)]
print([i for n in range(1, 8) for i in A333520(n)])
A375209
Number of simple symmetric Hamiltonian paths connecting opposite corners of a 2n+1 X 2n+1 grid.
Original entry on oeis.org
1, 2, 16, 564, 93866, 72054120, 260324223938, 4400423201461008, 349815282628284276844, 130501147375292529852604266, 228964256366276749773274186140858
Offset: 0
a(2) = 16, see link "Illustration".
Thanks to Suleiman Makarenko.
A363577
Number of inequivalent Hamiltonian paths starting in the lower left corner of an n X n grid graph (paths differing only by rotations and reflections are regarded as equivalent).
Original entry on oeis.org
1, 1, 3, 23, 347, 10199, 683227, 85612967, 25777385143, 14396323278040, 19799561204761862, 50351228336401026361, 319210377672595552740369, 3736517399241599771428011100, 109790442395888863208285555153329, 5952238893391106787883489313797219949
Offset: 1
There are 3 paths for n=3:
+--+--+ +--+--+ +--+ +
| | | | | | |
+ + + + +--+ + + +
| | | | | | | |
+ +--+ + +--+ + +--+
A fourth path:
+--+--+
|
+--+ +
| | |
+ +--+
is the same as the second one in the row above after a 90-degree rotation.
All paths starting E are the same as the corresponding ones starting N after reflection in the forward diagonal.
Comments