A333466
Number of self-avoiding closed paths on an n X n grid which pass through four corners ((0,0), (0,n-1), (n-1,n-1), (n-1,0)).
Original entry on oeis.org
1, 1, 11, 373, 44930, 17720400, 22013629316, 84579095455492
Offset: 2
a(2) = 1;
+--+
| |
+--+
a(3) = 1;
+--*--+
| |
* *
| |
+--*--+
a(4) = 11;
+--*--*--+ +--*--*--+ +--*--*--+
| | | | | |
*--*--* * *--* *--* *--* *
| | | | | |
*--*--* * *--* *--* *--* *
| | | | | |
+--*--*--+ +--*--*--+ +--*--*--+
+--*--*--+ +--*--*--+ +--*--*--+
| | | | | |
* *--*--* * *--* * * *--*
| | | | | | | |
* *--*--* * * * * * *--*
| | | | | | | |
+--*--*--+ +--* *--+ +--*--*--+
+--*--*--+ +--*--*--+ +--* *--+
| | | | | | | |
* * * * * *--* *
| | | | | |
* *--* * * * * *--* *
| | | | | | | | | |
+--* *--+ +--*--*--+ +--* *--+
+--* *--+ +--* *--+
| | | | | | | |
* *--* * * * * *
| | | | | |
* * * *--* *
| | | |
+--*--*--+ +--*--*--+
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333466(n):
universe = tl.grid(n - 1, n - 1)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles()
for i in [1, n, n * (n - 1) + 1, n * n]:
cycles = cycles.including(i)
return cycles.len()
print([A333466(n) for n in range(2, 10)])
-
def search(x, y, n, used)
return 0 if x < 0 || n <= x || y < 0 || n <= y || used[x + y * n]
return 1 if x == 0 && y == 1 && [n - 1, n * (n - 1), n * n - 1].all?{|i| used[i] == true}
cnt = 0
used[x + y * n] = true
@move.each{|mo|
cnt += search(x + mo[0], y + mo[1], n, used)
}
used[x + y * n] = false
cnt
end
def A(n)
return 1 if n < 3
@move = [[1, 0], [-1, 0], [0, 1], [0, -1]]
used = Array.new(n * n, false)
search(0, 0, n, used)
end
def A333466(n)
(2..n).map{|i| A(i)}
end
p A333466(6)
A333246
Number of self-avoiding closed paths on an n X n grid which pass through NW corner.
Original entry on oeis.org
1, 7, 97, 4111, 532269, 212372937, 263708907211, 1013068026356375, 11955420069208095719, 432101605951906251627393, 47778407166747833830058004149, 16149888968763663448192636077980753, 16675786862526496319891707194153887550751, 52568166380872328447478940416604864445574575709
Offset: 2
a(2) = 1;
+--*
| |
*--*
a(3) = 7;
+--* +--*--* +--*--* +--*
| | | | | | | |
*--* *--*--* * * * *
| | | |
*--*--* *--*
+--*--* +--*--* +--*
| | | | | |
* *--* *--* * * *--*
| | | | | |
*--* *--* *--*--*
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333246(n):
universe = tl.grid(n - 1, n - 1)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles().including(1)
return cycles.len()
print([A333246(n) for n in range(2, 10)])
A333323
Number of self-avoiding closed paths on an n X n grid which pass through NW and SE corners.
Original entry on oeis.org
1, 3, 42, 1799, 232094, 92617031, 115156685746, 442641690778179, 5224287477491915786, 188825256606226776728029, 20879416139356164466643759334, 7057757437924198729598570424130207, 7287699030020917172151307665469211016474, 22973720258279267139936821063450448822110219653
Offset: 2
a(2) = 1;
+--*
| |
*--+
a(3) = 3;
+--*--* +--*--* +--*
| | | | | |
*--* * * * * *--*
| | | | | |
*--+ *--*--+ *--*--+
- Anthony J. Guttmann and Iwan Jensen, Table of n, a(n) for n = 2..27
- Anthony J. Guttmann and Iwan Jensen, Self-avoiding walks and polygons crossing a domain on the square and hexagonal lattices, arXiv:2208.06744 [math-ph], Aug 13 2022, Table D2 (with offset 1).
- Anthony J. Guttmann and Iwan Jensen, The gerrymander sequence, or A348456, arXiv:2211.14482 [math.CO], 2022.
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333323(n):
universe = tl.grid(n - 1, n - 1)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles().including(1).including(n * n)
return cycles.len()
print([A333323(n) for n in range(2, 10)])
A333652
Triangle T(n,k), n >= 2, 0 <= k <= floor(n^2/2)-n, read by rows, where T(n,k) is the number of 2*(k+n)-cycles in the n X n grid graph which pass through NW and SW corners.
Original entry on oeis.org
1, 1, 3, 1, 6, 17, 17, 6, 1, 10, 45, 167, 404, 570, 460, 186, 1, 15, 100, 506, 2164, 7726, 20483, 39401, 56015, 57632, 37450, 10340, 1072, 1, 21, 196, 1316, 7066, 33983, 147377, 546400, 1656592, 4099732, 8394433, 14227675, 19443270, 20239262, 14767415, 7007270, 1926990, 230440
Offset: 2
T(3,0) = 1;
+--*
| |
* *
| |
+--*
T(3,1) = 3;
+--*--* +--*--* +--*
| | | | | |
* * * *--* * *--*
| | | | | |
+--*--* +--* +--*--*
Triangle starts:
====================================================================
n\k| 0 1 2 3 4 ... 7 ... 12 ... 17 ... 24
---|----------------------------------------------------------------
2 | 1;
3 | 1, 3;
4 | 1, 6, 17, 17, 6;
5 | 1, 10, 45, 167, 404, ... , 186;
6 | 1, 15, 100, 506, 2164, .......... , 1072;
7 | 1, 21, 196, 1316, 7066, .................. , 230440;
8 | 1, 28, 350, 3038, 20317, ............................ , 4638576;
-
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333652(n):
universe = tl.grid(n - 1, n - 1)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles().including(1).including(n)
return [cycles.len(2 * k).len() for k in range(n, n * n // 2 + 1)]
print([i for n in range(2, 8) for i in A333652(n)])
Showing 1-4 of 4 results.
Comments