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.

A302337 Triangle read by rows: T(n,k) is the number of 2k-cycles in the n X n grid graph (2 <= k <= floor(n^2/2), n >= 2).

This page as a plain text file.
%I A302337 #22 Feb 16 2025 08:33:53
%S A302337 1,4,4,5,9,12,26,52,76,32,6,16,24,61,164,446,1100,2102,2436,1874,900,
%T A302337 226,25,40,110,332,1070,3504,11144,32172,77874,146680,217470,255156,
%U A302337 233786,158652,69544,13732,1072,36,60,173,556,1942,7092,26424,97624,346428,1136164,3313812,8342388,18064642,33777148,54661008,76165128,89790912,86547168,64626638,34785284,12527632,2677024,255088
%N A302337 Triangle read by rows: T(n,k) is the number of 2k-cycles in the n X n grid graph (2 <= k <= floor(n^2/2), n >= 2).
%H A302337 Seiichi Manyama, <a href="/A302337/b302337.txt">Rows n = 2..9, flattened</a>
%H A302337 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GraphCycle.html">Graph Cycle</a>
%H A302337 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GridGraph.html">Grid Graph</a>
%F A302337 Row sums equal A140517(n).
%F A302337 Length of row n equals A047838(n) = floor(n^2/2) - 1.
%F A302337 T(n,2) =    1 -   2*n +     n^2 = (n-1)^2.
%F A302337 T(n,3) =    4 -   6*n +   2*n^2 = A046092(n-2).
%F A302337 T(n,4) =   26 -  28*n +   7*n^2 for n > 2.
%F A302337 T(n,5) =  164 - 140*n +  28*n^2 for n > 3.
%F A302337 T(n,6) = 1046 - 740*n + 124*n^2 for n > 4.
%F A302337 T(n,k) = A302335(k) - A302336(k)*n + A002931(k)*n^2 for n > k-2.
%F A302337 T(n,floor(n^2/2)) = A301648(n).
%F A302337 T(n,n^2/2) = A003763(n) for n even.
%e A302337 Triangle begins:
%e A302337    1;
%e A302337    4,  4,  5;
%e A302337    9, 12, 26,  52,  76,   32,    6;
%e A302337   16, 24, 61, 164, 446, 1100, 2102, 2436, 1874, 900, 226;
%e A302337   ...
%e A302337 So for example, the 3 X 3 grid graph has 4 4-cycles, 4 6-cycles, and 5 8-cycles.
%t A302337 Flatten[Table[Tally[Length /@ FindCycle[GridGraph[{n, n}], Infinity, All]][[All, 2]], {n, 6}]] (* _Eric W. Weisstein_, Mar 26 2021 *)
%o A302337 (Python)
%o A302337 # Using graphillion
%o A302337 from graphillion import GraphSet
%o A302337 import graphillion.tutorial as tl
%o A302337 def A302337(n):
%o A302337     universe = tl.grid(n - 1, n - 1)
%o A302337     GraphSet.set_universe(universe)
%o A302337     cycles = GraphSet.cycles()
%o A302337     return [cycles.len(2 * k).len() for k in range(2, n * n // 2 + 1)]
%o A302337 print([i for n in range(2, 8) for i in A302337(n)])  # _Seiichi Manyama_, Mar 29 2020
%Y A302337 Cf. A003763 (number of Hamiltonian cycles in 2n X 2n grid graph).
%Y A302337 Cf. A140517 (number of cycles).
%Y A302337 Cf. A301648 (number of longest cycles).
%K A302337 nonn,tabf
%O A302337 2,2
%A A302337 _Eric W. Weisstein_, Apr 05 2018