A271507 Number of self-avoiding walks of any length from NW to SW corners on an n X n grid or lattice.
1, 2, 11, 178, 8590, 1246850, 550254085, 741333619848, 3046540983075504, 38141694646516492843, 1453908228148524205711098, 168707605740228097581729005751, 59588304533380500951726150179910606, 64061403305026776755367065417308840021540
Offset: 1
Keywords
Programs
-
Mathematica
A271465 = Cases[Import["https://oeis.org/A271465/b271465.txt", "Table"], {, }][[All, 2]]; a[n_] := A271465[[2 n^2 - 2 n + 1]]; Table[a[n], {n, 1, 14}] (* Jean-François Alcover, Sep 23 2019 *)
-
Python
# Using graphillion from graphillion import GraphSet import graphillion.tutorial as tl def A271507(n): if n == 1: return 1 universe = tl.grid(n - 1, n - 1) GraphSet.set_universe(universe) start, goal = 1, n paths = GraphSet.paths(start, goal) return paths.len() print([A271507(n) for n in range(1, 10)]) # Seiichi Manyama, Mar 21 2020