A296527 Number of (undirected) cycles in the n X n torus grid graph.
312, 14704, 2183490, 995818716, 1383238940818, 5846378997135040, 75162787766308673244
Offset: 3
Links
- Eric Weisstein's World of Mathematics, Graph Cycle.
- Eric Weisstein's World of Mathematics, Torus Grid Graph.
Programs
-
Mathematica
Table[Length[FindCycle[GraphProduct[CycleGraph[n], CycleGraph[n], "Cartesian"], Infinity, All]], {n, 3, 5}] (* Eric W. Weisstein, Dec 16 2023 *)
-
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
Extensions
a(7) from Andrew Howroyd, Dec 14 2017
a(8)-a(9) from Ed Wynn, Jun 28 2023