A333510
Number of self-avoiding walks in the n X 2 grid graph which start at any of the n vertices on left side of the graph and terminate at any of the n vertices on the right side.
Original entry on oeis.org
1, 8, 29, 80, 195, 444, 969, 2056, 4279, 8788, 17885, 36176, 72875, 146412, 293649, 588312, 1177855, 2357188, 4716133, 9434336, 18871091, 37744988, 75493209, 150990120, 301984455, 603973684, 1207952749, 2415911536, 4831829819, 9663667148, 19327342625, 38654694456, 77309399055, 154618809252
Offset: 1
a(1) = 1;
+--+
a(2) = 8;
+--+ + + +--* + *
| | | |
* * *--* * + *--+
-------------------------
*--+ * + *--* * *
| | | |
+ * +--* + + +--+
a(3) = 29;
+--+ + + + + +--* + *
| | | | | |
* * *--* * * * + *--+
| |
* * * * *--* * * * *
--------------------------------
+ * +--* +--* + * + *
| | | | |
* + *--* * * *--* * *
| | | | | |
*--* *--+ * + * + *--+
--------------------------------
*--+ * + * + *--* * *
| | | | |
+ * +--* + * + + +--+
| |
* * * * *--+ * * * *
--------------------------------
* * *--* * * * * *--+
| | |
+ + + * +--* + * *--*
| | | | | |
*--* * + * + *--+ +--*
--------------------------------
*--+ * + * + *--* * *
| | | | |
* * *--* * * * + *--+
| | | | |
+ * + * +--* + * + *
--------------------------------
* * *--* * * * *
| |
* + * * *--* * *
| | | | |
+--* + + + + +--+
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A(start, goal, n, k):
universe = tl.grid(n - 1, k - 1)
GraphSet.set_universe(universe)
paths = GraphSet.paths(start, goal)
return paths.len()
def A333509(n, k):
if n == 1: return 1
s = 0
for i in range(1, n + 1):
for j in range(k * n - n + 1, k * n + 1):
s += A(i, j, k, n)
return s
def A333510(n):
return A333509(n, 2)
print([A333510(n) for n in range(1, 20)])
A333511
Number of self-avoiding walks in the n X 3 grid graph which start at any of the n vertices on left side of the graph and terminate at any of the n vertices on the right side.
Original entry on oeis.org
1, 16, 95, 426, 1745, 6838, 25897, 95292, 342505, 1208392, 4201765, 14445130, 49221691, 166563454, 560595853, 1878809676, 6275993883, 20910561068
Offset: 1
a(1) = 1;
+--*--+
a(2) = 16;
+ *--+ + * + +--* + +--*--+
| | | | | |
*--* * *--*--* * *--* * * *
-------------------------------------
+ *--* + * * +--* * +--*--*
| | | | | |
*--* + *--*--+ * *--+ * * +
-------------------------------------
*--* + *--*--+ * *--+ * * +
| | | | | |
+ *--* + * * +--* * +--*--*
-------------------------------------
*--* * *--*--* * *--* * * *
| | | | | |
+ *--+ + * + +--* + +--*--+
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A(start, goal, n, k):
universe = tl.grid(n - 1, k - 1)
GraphSet.set_universe(universe)
paths = GraphSet.paths(start, goal)
return paths.len()
def A333509(n, k):
if n == 1: return 1
s = 0
for i in range(1, n + 1):
for j in range(k * n - n + 1, k * n + 1):
s += A(i, j, k, n)
return s
def A333511(n):
return A333509(n, 3)
print([A333511(n) for n in range(1, 15)])
A333571
Square array T(n,k), n >= 1, k >= 2, read by antidiagonals, where T(n,k) is the number of Hamiltonian paths in the n X k grid graph which start at any of the n vertices on left side of the graph and terminate at any of the n vertices on the right side.
Original entry on oeis.org
1, 1, 2, 1, 2, 4, 1, 2, 8, 6, 1, 2, 16, 14, 10, 1, 2, 32, 34, 38, 14, 1, 2, 64, 80, 162, 74, 20, 1, 2, 128, 190, 650, 426, 170, 26, 1, 2, 256, 450, 2728, 2166, 1594, 338, 34, 1, 2, 512, 1066, 11250, 12014, 12908, 4374, 724, 42, 1, 2, 1024, 2526, 46984, 62714, 119364, 47738, 14640, 1448, 52
Offset: 1
Square array T(n,k) begins:
1, 1, 1, 1, 1, 1, 1, ...
2, 2, 2, 2, 2, 2, 2, ...
4, 8, 16, 32, 64, 128, 256, ...
6, 14, 34, 80, 190, 450, 1066, ...
10, 38, 162, 650, 2728, 11250, 46984, ...
14, 74, 426, 2166, 12014, 62714, 340510, ...
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A(start, goal, n, k):
universe = tl.grid(n - 1, k - 1)
GraphSet.set_universe(universe)
paths = GraphSet.paths(start, goal, is_hamilton=True)
return paths.len()
def A333571(n, k):
if n == 1: return 1
s = 0
for i in range(1, n + 1):
for j in range(k * n - n + 1, k * n + 1):
s += A(i, j, k, n)
return s
print([A333571(j + 1, i - j + 2) for i in range(11) for j in range(i + 1)])
Showing 1-3 of 3 results.