login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A003689 Number of Hamiltonian paths in K_3 X P_n. 3
3, 30, 144, 588, 2160, 7440, 24576, 78912, 248448, 771456, 2371968, 7241856, 21998976, 66586752, 201025920, 605781120, 1823094144, 5481472128, 16470172032, 49464779904, 148508372352, 445764192384, 1337792747904 (list; graph; refs; listen; history; text; internal format)
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
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.
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
Sequence in context: A174774 A020874 A161806 * A127868 A002463 A360645
KEYWORD
nonn,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)