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.

A338532 Number of spanning trees in the n X 3 king graph.

This page as a plain text file.
%I A338532 #70 Feb 16 2025 08:34:00
%S A338532 1,192,17745,1612127,146356224,13286470095,1206167003329,
%T A338532 109497763028928,9940381426772625,902403667119137183,
%U A338532 81921642989758089216,7436977302591050167695,675140651246077550931841,61290344237862763973468352,5564035123440571957929508305,505111975464406109413779799007
%N A338532 Number of spanning trees in the n X 3 king graph.
%H A338532 Seiichi Manyama, <a href="/A338532/b338532.txt">Table of n, a(n) for n = 1..500</a>
%H A338532 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/KingGraph.html">King Graph</a>
%H A338532 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SpanningTree.html">Spanning Tree</a>
%F A338532 Empirical g.f.: x*(-15*x^3 - 111*x^2 + 97*x + 1) / (x^4 - 95*x^3 + 384*x^2 - 95*x + 1). - _Vaclav Kotesovec_, Dec 04 2020
%o A338532 (Python)
%o A338532 # Using graphillion
%o A338532 from graphillion import GraphSet
%o A338532 def make_nXk_king_graph(n, k):
%o A338532     grids = []
%o A338532     for i in range(1, k + 1):
%o A338532         for j in range(1, n):
%o A338532             grids.append((i + (j - 1) * k, i + j * k))
%o A338532             if i < k:
%o A338532                 grids.append((i + (j - 1) * k, i + j * k + 1))
%o A338532             if i > 1:
%o A338532                 grids.append((i + (j - 1) * k, i + j * k - 1))
%o A338532     for i in range(1, k * n, k):
%o A338532         for j in range(1, k):
%o A338532             grids.append((i + j - 1, i + j))
%o A338532     return grids
%o A338532 def A338029(n, k):
%o A338532     if n == 1 or k == 1: return 1
%o A338532     universe = make_nXk_king_graph(n, k)
%o A338532     GraphSet.set_universe(universe)
%o A338532     spanning_trees = GraphSet.trees(is_spanning=True)
%o A338532     return spanning_trees.len()
%o A338532 def A338532(n):
%o A338532     return A338029(n, 3)
%o A338532 print([A338532(n) for n in range(1, 20)])
%Y A338532 Column 3 of A338029.
%Y A338532 Cf. A006238.
%K A338532 nonn
%O A338532 1,2
%A A338532 _Seiichi Manyama_, Nov 29 2020