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.

A283241 Triangle read by rows: S(n,k) = total number of directed self-avoiding walks (SAWs) of length k in an n-ladder graph.

This page as a plain text file.
%I A283241 #16 Feb 16 2025 08:33:42
%S A283241 2,2,4,8,8,8,6,14,20,28,20,16,8,20,32,52,56,64,40,28,10,26,44,76,96,
%T A283241 132,128,128,72,44,12,32,56,100,136,204,240,296,264,232,120,64,14,38,
%U A283241 68,124,176,276,356,492,548,608,504,392,188,88
%N A283241 Triangle read by rows: S(n,k) = total number of directed self-avoiding walks (SAWs) of length k in an n-ladder graph.
%C A283241 n is the number of rows in the ladder graph, i.e., L_n.
%C A283241 k is the length of the directed SAWs. k = 0 represents the single nodes with no edges.
%C A283241 S(n,k) is the number of distinct SAWs of length k in the n-ladder graph.
%H A283241 OEIS, <a href="https://oeis.org/wiki/Self-avoiding_walks">Self-avoiding walks</a>.
%H A283241 Wikipedia, <a href="https://en.wikipedia.org/wiki/Ladder_graph">Ladder graph</a>.
%H A283241 Wolfram MathWorld, <a href="https://mathworld.wolfram.com/LadderGraph.html">Ladder Graph</a>.
%F A283241 Using T(n,k) from A283240,
%F A283241 S(n,k) = T(n,k) + 2*T(n,k-1) + 3*T(n,k-2) + 4*T(n,k-4) + ... + (k+1)*T(n,0)
%e A283241 Triangle S(n,k) begins:
%e A283241 n/k  0   1    2    3    4    5    6     7     8     9    10    11    12    13    14    15    16    17   18   19
%e A283241 1    2   2
%e A283241 2    4   8    8    8
%e A283241 3    6  14   20   28   20   16
%e A283241 4    8  20   32   52   56   64   40    28
%e A283241 5   10  26   44   76   96  132  128   128    72    44
%e A283241 6   12  32   56  100  136  204  240   296   264   232   120    64
%e A283241 7   14  38   68  124  176  276  356   492   548   608   504   392   188    88
%e A283241 8   16  44   80  148  216  348  472   692   864  1104  1168  1172   904   628   280   116
%e A283241 9   18  50   92  172  256  420  588   892  1184  1636  1984  2352  2352  2148  1540   964   400   148
%e A283241 10  20  56  104  196  296  492  704  1092  1504  2172  2840  3720  4352  4800  4512  3772  2512  1428  552  184
%e A283241 e.g., there are T(3,3) = 28 directed SAWs of length 3 in L_3.
%e A283241 Fourteen shapes walked in both directions:
%e A283241 >   _          _
%e A283241 >  |     |      |      |    |_      _|
%e A283241 >  |     |_     |     _|      |    |
%e A283241 >                 _    . .    _     _   . .  . .
%e A283241 >  |_|    . .    | |    _    |_     _|   _    _
%e A283241 >  . .    |_|    . .   | |   . .   . .  |_    _|
%o A283241 (Python)
%o A283241 # As A283240 but Tnk initialized as grid instead of a triangle
%o A283241 maxN=20
%o A283241 Tnk=[[0 for column in range(0, maxN*2)] for row in range(0, maxN+1)]
%o A283241 Tnk[1][0]=2 # initial values for the special case of 1-ladder.  Two single nodes.
%o A283241 Tnk[1][1]=2 # SAW of length 1 on a L_1, either left or right
%o A283241 for row in range(2, maxN+1):
%o A283241     for column in range(0, row*2):
%o A283241         if(column+1 < row):
%o A283241             # path is smaller than ladder - no possible SAW using all rows
%o A283241             Tnk[row][column] = 0
%o A283241         elif(column+1 == row):
%o A283241             # vertical SAW, 2 possible in 2 directions
%o A283241             Tnk[row][column] = 4
%o A283241         elif(column == row*2 -1):
%o A283241             # n-ladder Hamiltonian A137882
%o A283241             Tnk[row][column] = 2*(row*row - row + 2)
%o A283241         elif(column == 2*(row-1)):
%o A283241             # Grow SAW including Hamiltonians from previous row, 4 extra SAWs from Hamiltonians
%o A283241             Tnk[row][column] = Tnk[row-1][column-1] + Tnk[row-1][column-2] + 4
%o A283241         else:
%o A283241             # Grow SAW from previous SAWs. Either adding one or two edges
%o A283241             Tnk[row][column] = Tnk[row-1][column-1] + Tnk[row-1][column-2]
%o A283241 # Sum multiples of the columns above this one e.g. T(n,k) + 2T(n,k-1) + 3T(n,k-2) + ...
%o A283241 Snk=[[0 for column in range(0,row*2)] for row in range(0,maxN+1)]
%o A283241 for row in range(1,maxN+1):
%o A283241     for column in range(0,(row*2)):
%o A283241         for i in range(0,row):
%o A283241             Snk[row][column]+=(i+1)*Tnk[row-i][column]
%o A283241 print(Snk)
%Y A283241 Uses A283240 for the number of n-ladders with no empty rows.
%Y A283241 The right diagonal is the number of directed Hamiltonian paths in the n-ladder graph (A137882).
%K A283241 nonn,tabf,walk
%O A283241 1,1
%A A283241 _Hector J. Partridge_, Mar 03 2017