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.

A339751 Number of (undirected) paths in the 3 X n king graph.

This page as a plain text file.
%I A339751 #22 Feb 16 2025 08:34:01
%S A339751 3,235,5148,96956,1622015,25281625,375341540,5384233910,75321922433,
%T A339751 1034169469257,13999362291892,187462552894846,2489361245031701,
%U A339751 32843155609675341,431132757745615932,5637280548371484492,73484574453020315121,955615821857238062353,12403944194214668554202
%N A339751 Number of (undirected) paths in the 3 X n king graph.
%H A339751 Seiichi Manyama, <a href="/A339751/b339751.txt">Table of n, a(n) for n = 1..40</a>
%H A339751 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GraphPath.html">Graph Path</a>
%H A339751 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/KingGraph.html">King Graph</a>
%F A339751 Empirical g.f.: x*(3 + 142*x - 1234*x^2 + 6033*x^3 - 4437*x^4 + 1913*x^5 - 647*x^6 + 24874*x^7 + 25724*x^8 + 1737*x^9 + 10969*x^10 + 22767*x^11 + 24670*x^12 + 12330*x^13 + 1616*x^14 + 240*x^15 + 1008*x^16) / ((1 - x)^2 * (-1 + 8*x + 14*x^2 + 5*x^3 + 6*x^4)^2*(1 - 13*x - 2*x^2 + 45*x^3 - 24*x^4 - 22*x^5 + 9*x^6 + 8*x^7 - 6*x^8)). - _Vaclav Kotesovec_, Dec 16 2020
%o A339751 (Python)
%o A339751 # Using graphillion
%o A339751 from graphillion import GraphSet
%o A339751 def make_nXk_king_graph(n, k):
%o A339751     grids = []
%o A339751     for i in range(1, k + 1):
%o A339751         for j in range(1, n):
%o A339751             grids.append((i + (j - 1) * k, i + j * k))
%o A339751             if i < k:
%o A339751                 grids.append((i + (j - 1) * k, i + j * k + 1))
%o A339751             if i > 1:
%o A339751                 grids.append((i + (j - 1) * k, i + j * k - 1))
%o A339751     for i in range(1, k * n, k):
%o A339751         for j in range(1, k):
%o A339751             grids.append((i + j - 1, i + j))
%o A339751     return grids
%o A339751 def A(start, goal, n, k):
%o A339751     universe = make_nXk_king_graph(n, k)
%o A339751     GraphSet.set_universe(universe)
%o A339751     paths = GraphSet.paths(start, goal)
%o A339751     return paths.len()
%o A339751 def A307026(n, k):
%o A339751     m = k * n
%o A339751     s = 0
%o A339751     for i in range(1, m):
%o A339751         for j in range(i + 1, m + 1):
%o A339751             s += A(i, j, n, k)
%o A339751     return s
%o A339751 def A339751(n):
%o A339751     return A307026(n, 3)
%o A339751 print([A339751(n) for n in range(1, 21)])
%Y A339751 Row 3 of A307026.
%Y A339751 Cf. A288527, A339761.
%K A339751 nonn
%O A339751 1,1
%A A339751 _Seiichi Manyama_, Dec 15 2020