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).
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
Examples
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;
Links
- Seiichi Manyama, Rows n = 1..9, flattened
Crossrefs
Programs
-
Python
# 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)])