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.

A339796 Number of (undirected) paths in the graph C_4 X C_n.

This page as a plain text file.
%I A339796 #16 Feb 16 2025 08:34:01
%S A339796 41676,725408,10489660,136547568,1660652028,19269238080,216100013292,
%T A339796 2362533383920,25329574375116,267467192029728,2790488055689724,
%U A339796 28832824624840880,295579830237167580,3010545385659678848,30497626012737910348,307541698683047474544
%N A339796 Number of (undirected) paths in the graph C_4 X C_n.
%H A339796 Seiichi Manyama, <a href="/A339796/b339796.txt">Table of n, a(n) for n = 3..37</a>
%H A339796 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TorusGridGraph.html">Torus Grid Graph</a>
%o A339796 (Python)
%o A339796 # Using graphillion
%o A339796 from graphillion import GraphSet
%o A339796 def make_CnXCk(n, k):
%o A339796     grids = []
%o A339796     for i in range(1, k + 1):
%o A339796         for j in range(1, n):
%o A339796             grids.append((i + (j - 1) * k, i + j * k))
%o A339796         grids.append((i + (n - 1) * k, i))
%o A339796     for i in range(1, k * n, k):
%o A339796         for j in range(1, k):
%o A339796             grids.append((i + j - 1, i + j))
%o A339796         grids.append((i + k - 1, i))
%o A339796     return grids
%o A339796 def A(start, goal, n, k):
%o A339796     universe = make_CnXCk(n, k)
%o A339796     GraphSet.set_universe(universe)
%o A339796     paths = GraphSet.paths(start, goal)
%o A339796     return paths.len()
%o A339796 def B(n, k):
%o A339796     m = k * n
%o A339796     s = 0
%o A339796     for i in range(1, m):
%o A339796         for j in range(i + 1, m + 1):
%o A339796             s += A(i, j, n, k)
%o A339796     return s
%o A339796 def A339796(n):
%o A339796     return B(n, 4)
%o A339796 print([A339796(n) for n in range(3, 10)])
%Y A339796 Cf. A307919, A339795, A358869, A358872.
%Y A339796 Cf. A339075, A339798 (Hamiltonian paths).
%K A339796 nonn
%O A339796 3,1
%A A339796 _Seiichi Manyama_, Dec 17 2020