login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A339797 Number of (undirected) Hamiltonian paths in the graph C_3 X C_n. 5

%I #14 Dec 04 2022 09:26:48

%S 756,4128,18240,73368,277536,1001760,3512160,12009480,40390944,

%T 133893936,439304736,1428450072,4613176800,14809528896,47315578848,

%U 150534443304,477237381024,1508232832080,4753573999776,14945425070136,46886868887136,146802927436128,458818252975200

%N Number of (undirected) Hamiltonian paths in the graph C_3 X C_n.

%H Seiichi Manyama, <a href="/A339797/b339797.txt">Table of n, a(n) for n = 3..50</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HamiltonianPath.html">Hamiltonian Path</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TorusGridGraph.html">Torus Grid Graph</a>

%o (Python)

%o # Using graphillion

%o from graphillion import GraphSet

%o def make_CnXCk(n, k):

%o grids = []

%o for i in range(1, k + 1):

%o for j in range(1, n):

%o grids.append((i + (j - 1) * k, i + j * k))

%o grids.append((i + (n - 1) * k, i))

%o for i in range(1, k * n, k):

%o for j in range(1, k):

%o grids.append((i + j - 1, i + j))

%o grids.append((i + k - 1, i))

%o return grids

%o def A(start, goal, n, k):

%o universe = make_CnXCk(n, k)

%o GraphSet.set_universe(universe)

%o paths = GraphSet.paths(start, goal, is_hamilton=True)

%o return paths.len()

%o def B(n, k):

%o m = k * n

%o s = 0

%o for i in range(1, m):

%o for j in range(i + 1, m + 1):

%o s += A(i, j, n, k)

%o return s

%o def A339797(n):

%o return B(n, 3)

%o print([A339797(n) for n in range(3, 10)])

%Y Cf. A003685, A268838, A339795, A339798.

%K nonn

%O 3,1

%A _Seiichi Manyama_, Dec 17 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 11:36 EDT 2024. Contains 371968 sequences. (Running on oeis4.)