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.

A283240 Triangle read by rows: T(n,k) = number of directed self-avoiding walks (SAWs) of length k in an n-ladder graph that use all rows of the graph.

This page as a plain text file.
%I A283240 #18 Feb 16 2025 08:33:42
%S A283240 2,2,0,4,8,8,0,0,4,12,20,16,0,0,0,4,16,32,40,28,0,0,0,0,4,20,48,72,72,
%T A283240 44,0,0,0,0,0,4,24,68,120,144,120,64,0,0,0,0,0,0,4,28,92,188,264,264,
%U A283240 188,88,0,0,0,0,0,0,0,4,32,120,280,452,528,452,280,116
%N A283240 Triangle read by rows: T(n,k) = number of directed self-avoiding walks (SAWs) of length k in an n-ladder graph that use all rows of the graph.
%C A283240 n is the number of rows in the ladder graph, i.e., L_n.
%C A283240 k is the length of the directed SAWs. k = 0 represents the single nodes with no edges.
%C A283240 T(n,k) is the number of directed SAWs which use at least one node from every row.
%H A283240 OEIS, <a href="https://oeis.org/wiki/Self-avoiding_walks">Self-avoiding walks</a>.
%H A283240 Wikipedia, <a href="https://en.wikipedia.org/wiki/Ladder_graph">Ladder graph</a>.
%H A283240 Wolfram MathWorld, <a href="https://mathworld.wolfram.com/LadderGraph.html">Ladder Graph</a>.
%F A283240 T(n,k) = 0                              when k+1 < n
%F A283240 T(n,k) = 4                              when k+1 = n
%F A283240 T(n,k) = 2(n^2-n+2)                     when k = 2n-1
%F A283240 T(n,k) = T(n-1,k-1) + T(n-1,k-2) + 4    when k = 2n-2
%F A283240 T(n,k) = T(n-1,k-1) + T(n-1,k-2)        otherwise
%e A283240 Triangle T(n,k) begins:
%e A283240 n/k 0  1  2   3   4   5   6   7    8     9  10   11   12    13    14    15    16    17   18   19
%e A283240 1   2  2
%e A283240 2   0  4  8   8
%e A283240 3   0  0  4  12  20  16
%e A283240 4   0  0  0   4  16  32  40  28
%e A283240 5   0  0  0   0   4  20  48  72   72   44
%e A283240 6   0  0  0   0   0   4  24  68  120  144  120   64
%e A283240 7   0  0  0   0   0   0   4  28   92  188  264  264  188    88
%e A283240 8   0  0  0   0   0   0   0   4   32  120  280  452  528   452   280   116
%e A283240 9   0  0  0   0   0   0   0   0    4   36  152  400  732   980   980   732   400   148
%e A283240 10  0  0  0   0   0   0   0   0    0    4   40  188  552  1132  1712  1960  1712  1132  552  184
%e A283240 e.g., there are T(3,3) = 12 directed SAWs of length 3 in L_3 that use at least one node from each row.
%e A283240 Six shapes walked in both directions.
%e A283240 >    _          _
%e A283240 >   |     |      |      |    |_      _|
%e A283240 >   |     |_     |     _|      |    |
%o A283240 (Python)
%o A283240 maxN=20
%o A283240 Tnk=[[0 for column in range(0, row*2)] for row in range(0,maxN+1)]
%o A283240 Tnk[1][0]=2 # initial values for the special case of 1-ladder.  Two single nodes.
%o A283240 Tnk[1][1]=2 # SAW of length 1 on a L_1, either left or right
%o A283240 for row in range(2,maxN+1):
%o A283240     for column in range(0, row*2):
%o A283240         if(column+1 < row):
%o A283240             # path is smaller than ladder - no possible SAW using all rows
%o A283240             Tnk[row][column] = 0
%o A283240         elif(column+1 == row):
%o A283240             # vertical SAW, 2 possible in 2 directions
%o A283240             Tnk[row][column] = 4
%o A283240         elif(column == row*2 -1):
%o A283240             # n-ladder Hamiltonian A137882
%o A283240             Tnk[row][column] = 2*(row*row - row + 2)
%o A283240         elif(column == 2*(row-1)):
%o A283240             # Grow SAW including Hamiltonians from previous row, 4 extra SAWs from Hamiltonians
%o A283240             Tnk[row][column] = Tnk[row-1][column-1] + Tnk[row-1][column-2] + 4
%o A283240         else:
%o A283240             # Grow SAW from previous SAWs. Either adding one or two edges
%o A283240             Tnk[row][column] = Tnk[row-1][column-1] + Tnk[row-1][column-2]
%o A283240 print(Tnk)
%Y A283240 The sum of each columns is twice A038577.
%Y A283240 The diagonal T(n,2n-1) are the number of directed Hamiltonian paths in the n-ladder graph A137882.
%Y A283240 Primarily used to calculate the total number of directed SAWs of length k in an n-ladder A283241.
%K A283240 nonn,tabf,walk
%O A283240 1,1
%A A283240 _Hector J. Partridge_, Mar 03 2017