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

%I #21 Dec 16 2020 11:35:09

%S 3,235,5148,96956,1622015,25281625,375341540,5384233910,75321922433,

%T 1034169469257,13999362291892,187462552894846,2489361245031701,

%U 32843155609675341,431132757745615932,5637280548371484492,73484574453020315121,955615821857238062353,12403944194214668554202

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

%H Seiichi Manyama, <a href="/A339751/b339751.txt">Table of n, a(n) for n = 1..40</a>

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

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

%F 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 (Python)

%o # Using graphillion

%o from graphillion import GraphSet

%o def make_nXk_king_graph(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 if i < k:

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

%o if i > 1:

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

%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 return grids

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

%o universe = make_nXk_king_graph(n, k)

%o GraphSet.set_universe(universe)

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

%o return paths.len()

%o def A307026(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 A339751(n):

%o return A307026(n, 3)

%o print([A339751(n) for n in range(1, 21)])

%Y Row 3 of A307026.

%Y Cf. A288527, A339761.

%K nonn

%O 1,1

%A _Seiichi Manyama_, Dec 15 2020