cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

This page as a plain text file.
%I A333520 #58 Apr 01 2020 03:21:58
%S A333520 1,2,6,4,2,20,36,48,48,32,70,224,510,956,1586,2224,2106,732,104,252,
%T A333520 1200,3904,10560,25828,58712,121868,217436,300380,280776,170384,61336,
%U A333520 10180,924,5940,25186,88084,277706,821480,2309402,6140040,15130410,33339900,62692432,96096244,116826664,110195700,78154858,39287872,12396758,1879252,111712
%N 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).
%H A333520 Seiichi Manyama, <a href="/A333520/b333520.txt">Rows n = 1..9, flattened</a>
%e A333520 T(3,1) = 4;
%e A333520    S--*      S--*--*   S  *--*   S
%e A333520       |            |   |  |  |   |
%e A333520    *--*         *--*   *--*  *   *  *--*
%e A333520    |            |            |   |  |  |
%e A333520    *--*--E      *--E         E   *--*  E
%e A333520 Triangle starts:
%e A333520 =======================================================
%e A333520 n\k|   0     1     2      3      4 ...      8 ...   12
%e A333520 ---|---------------------------------------------------
%e A333520 1  |   1;
%e A333520 2  |   2;
%e A333520 3  |   6,    4,    2;
%e A333520 4  |  20,   36,   48,    48,    32;
%e A333520 5  |  70,  224,  510,   956,  1586, ... , 104;
%e A333520 6  | 252, 1200, 3904, 10560, ................. , 10180;
%o A333520 (Python)
%o A333520 # Using graphillion
%o A333520 from graphillion import GraphSet
%o A333520 import graphillion.tutorial as tl
%o A333520 def A333520(n):
%o A333520     if n == 1: return [1]
%o A333520     universe = tl.grid(n - 1, n - 1)
%o A333520     GraphSet.set_universe(universe)
%o A333520     start, goal = 1, n * n
%o A333520     paths = GraphSet.paths(start, goal)
%o A333520     return [paths.len(2 * (n - 1 + k)).len() for k in range((n - 1) ** 2 // 2 + 1)]
%o A333520 print([i for n in range(1, 8) for i in A333520(n)])
%Y A333520 Row sums give A007764.
%Y A333520 T(n,0) gives A000984(n-1).
%Y A333520 T(n,1) gives A257888(n).
%Y A333520 T(n,floor((n-1)^2/2)) gives A121788(n-1).
%Y A333520 T(2*n-1,2*(n-1)^2) gives A001184(n-1).
%Y A333520 Cf. A074148, A302337, A329633.
%K A333520 nonn,tabf
%O A333520 1,2
%A A333520 _Seiichi Manyama_, Mar 29 2020