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.

A339762 Number of (undirected) Hamiltonian paths in the 4 X n king graph.

This page as a plain text file.
%I A339762 #16 Feb 16 2025 08:34:01
%S A339762 1,208,4678,171592,4743130,132202038,3461461060,88405359072,
%T A339762 2197293738684,53565801482634,1284136961473864,30365618160010650,
%U A339762 709700882866473654,16422374051280905778,376744989106882359402,8578133199326578887346,194030408441913214687458
%N A339762 Number of (undirected) Hamiltonian paths in the 4 X n king graph.
%H A339762 Andrew Howroyd, <a href="/A339762/b339762.txt">Table of n, a(n) for n = 1..200</a>
%H A339762 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GraphPath.html">Graph Path</a>
%H A339762 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/KingGraph.html">King Graph</a>
%o A339762 (Python)
%o A339762 # Using graphillion
%o A339762 from graphillion import GraphSet
%o A339762 def make_nXk_king_graph(n, k):
%o A339762     grids = []
%o A339762     for i in range(1, k + 1):
%o A339762         for j in range(1, n):
%o A339762             grids.append((i + (j - 1) * k, i + j * k))
%o A339762             if i < k:
%o A339762                 grids.append((i + (j - 1) * k, i + j * k + 1))
%o A339762             if i > 1:
%o A339762                 grids.append((i + (j - 1) * k, i + j * k - 1))
%o A339762     for i in range(1, k * n, k):
%o A339762         for j in range(1, k):
%o A339762             grids.append((i + j - 1, i + j))
%o A339762     return grids
%o A339762 def A(start, goal, n, k):
%o A339762     universe = make_nXk_king_graph(n, k)
%o A339762     GraphSet.set_universe(universe)
%o A339762     paths = GraphSet.paths(start, goal, is_hamilton=True)
%o A339762     return paths.len()
%o A339762 def B(n, k):
%o A339762     m = k * n
%o A339762     s = 0
%o A339762     for i in range(1, m):
%o A339762         for j in range(i + 1, m + 1):
%o A339762             s += A(i, j, n, k)
%o A339762     return s
%o A339762 def A339762(n):
%o A339762     return B(n, 4)
%o A339762 print([A339762(n) for n in range(1, 11)])
%Y A339762 Row 4 of A350729.
%Y A339762 Cf. A003695, A308129, A339760, A339761, A339763.
%K A339762 nonn
%O A339762 1,2
%A A339762 _Seiichi Manyama_, Dec 16 2020