login
A296527
Number of (undirected) cycles in the n X n torus grid graph.
7
312, 14704, 2183490, 995818716, 1383238940818, 5846378997135040, 75162787766308673244
OFFSET
3,1
LINKS
Eric Weisstein's World of Mathematics, Graph Cycle.
Eric Weisstein's World of Mathematics, Torus Grid Graph.
MATHEMATICA
Table[Length[FindCycle[GraphProduct[CycleGraph[n], CycleGraph[n], "Cartesian"], Infinity, All]], {n, 3, 5}] (* Eric W. Weisstein, Dec 16 2023 *)
PROG
(Python)
# Using graphillion
from graphillion import GraphSet
def make_CnXCk(n, k):
grids = []
for i in range(1, k + 1):
for j in range(1, n):
grids.append((i + (j - 1) * k, i + j * k))
grids.append((i + (n - 1) * k, i))
for i in range(1, k * n, k):
for j in range(1, k):
grids.append((i + j - 1, i + j))
grids.append((i + k - 1, i))
return grids
def A296527(n):
universe = make_CnXCk(n, n)
GraphSet.set_universe(universe)
cycles = GraphSet.cycles()
return cycles.len()
print([A296527(n) for n in range(3, 7)]) # Seiichi Manyama, Nov 22 2020
CROSSREFS
Sequence in context: A364992 A022044 A156403 * A107508 A015704 A156406
KEYWORD
nonn,more
AUTHOR
Eric W. Weisstein, Dec 14 2017
EXTENSIONS
a(7) from Andrew Howroyd, Dec 14 2017
a(8)-a(9) from Ed Wynn, Jun 28 2023
STATUS
approved