OFFSET
1,1
REFERENCES
F. Faase, On the number of specific spanning subgraphs of the graphs G X P_n, Ars Combin. 49 (1998), 129-154.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
F. Faase, On the number of specific spanning subgraphs of the graphs G X P_n, Preliminary version of paper that appeared in Ars Combin. 49 (1998), 129-154.
F. Faase, Results from the counting program
Index entries for linear recurrences with constant coefficients, signature (7,-16,12).
FORMULA
a(n) = 7*a(n-1) - 16*a(n-2) + 12*a(n-3), n>5.
a(n) = 128 * 3^(n-2) - (21*n + 57) * 2^(n-2), n>2. - Ralf Stephan, Sep 26 2004
G.f.: 3*x*(1+3*x-6*x^2+8*x^3-4*x^4) / ((1-3*x)*(1-2*x)^2). [R. J. Mathar, Dec 16 2008]
MATHEMATICA
Join[{3, 30}, LinearRecurrence[{7, -16, 12}, {144, 588, 2160}, 30]] (* Harvey P. Dale, Apr 26 2014 *)
CoefficientList[Series[3 (1 + 3 x - 6 x^2 + 8 x^3 - 4 x^4)/((1 - 3 x) (1 - 2 x)^2), {x, 0, 30}], x] (* Vincenzo Librandi, Apr 27 2014 *)
PROG
(Magma) [3, 30] cat [128*3^(n-2)-(21*n+57)*2^(n-2): n in [3..30]]; // Vincenzo Librandi, Apr 27 2014
(Python)
# Using graphillion
from graphillion import GraphSet
def make_CnXPk(n, k):
grids = []
for i in range(1, k + 1):
for j in range(1, n):
grids.append((i + (j - 1) * k, i + j * k))
grids.append((i + (n - 1) * k, i))
for i in range(1, k * n, k):
for j in range(1, k):
grids.append((i + j - 1, i + j))
return grids
def A(start, goal, n, k):
universe = make_CnXPk(n, k)
GraphSet.set_universe(universe)
paths = GraphSet.paths(start, goal, is_hamilton=True)
return paths.len()
def B(n, k):
m = k * n
s = 0
for i in range(1, m):
for j in range(i + 1, m + 1):
s += A(i, j, n, k)
return s
def A003689(n):
return B(3, n)
print([A003689(n) for n in range(1, 21)]) # Seiichi Manyama, Dec 18 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved