The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A333464 Number of self-avoiding walks from NW to SE corners on an n X n grid which pass through all points on the diagonal connecting NE and SW corners. 3
1, 0, 2, 20, 752, 84008, 29145982, 30795358024, 99417240957788 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
a(11) = 29262010991555584566654. - Seiichi Manyama, Apr 07 2020
LINKS
EXAMPLE
a(3) = 2;
S--*--+ S *--+
| | | |
*--+--* * + *
| | | |
+--*--E +--* E
a(4) = 20;
S--*--*--+ S--*--*--+ S--*--*--+
| | |
*--*--+--* *--*--+--* *--* +--*
| | | | |
* +--* * +--*--* * +--*
| | | | | | |
+--* *--E +--* E +--*--*--E
S--*--*--+ S--*--*--+ S--*--*--+
| | |
*--+--* *--+--* *--+ *
| | | | |
*--+ *--* *--+ *--+ *--*
| | | | |
+--*--* E +--*--*--E +--*--*--E
S--*--*--+ S--* *--+ S--* *--+
| | | | | | |
+--* *--* + * *--+ *
| | | | |
*--+--* * +--* * *--+--*--*
| | | | |
+--*--*--E +--* E +--*--*--E
S--* *--+ S *--*--+ S *--*--+
| | | | | | | | |
* + * *--* +--* * *--+ *
| | | | | | |
*--+ * * *--+--* * +--* *
| | | | | | |
+--*--* E +--*--*--E +--* E
S *--*--+ S *--*--+ S *--+
| | | | | | | | |
* * +--* * * +--* *--*--+ *
| | | | | | |
* + * * + *--* *--+--*--*
| | | | | | |
+--* *--E +--* E +--*--*--E
S *--+ S *--+ S *--+
| | | | | | | | |
*--* + * * *--+ * * *--+ *
| | | | | | | | |
*--+ * * * +--* * * + *--*
| | | | | | | | |
+--*--* E +--*--* E +--* *--E
S *--+ S *--+
| | | | | |
* *--+ * * + *
| | | | | |
* + * * +--* *
| | | | | |
+--* E +--* E
PROG
(Python)
# Using graphillion
from graphillion import GraphSet
import graphillion.tutorial as tl
def A333464(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)
for i in range(n):
paths = paths.including((n - 1) * (i + 1) + 1)
return paths.len()
print([A333464(n) for n in range(1, 10)])
(Ruby)
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 == n - 1 && y == n - 1 && (0..n - 1).all?{|i| used[(n - 1) * (i + 1)] == 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 == 1
@move = [[1, 0], [-1, 0], [0, 1], [0, -1]]
used = Array.new(n * n, false)
search(0, 0, n, used)
end
def A333464(n)
(1..n).map{|i| A(i)}
end
p A333464(6)
CROSSREFS
Sequence in context: A251183 A158268 A168407 * A356691 A163594 A193483
KEYWORD
nonn,more
AUTHOR
Seiichi Manyama, Mar 22 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 5 21:38 EDT 2024. Contains 373110 sequences. (Running on oeis4.)