A003689 Number of Hamiltonian paths in K_3 X P_n.
3, 30, 144, 588, 2160, 7440, 24576, 78912, 248448, 771456, 2371968, 7241856, 21998976, 66586752, 201025920, 605781120, 1823094144, 5481472128, 16470172032, 49464779904, 148508372352, 445764192384, 1337792747904
Offset: 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, Counting Hamiltonian cycles in product graphs
- F. Faase, Results from the counting program
- Index entries for linear recurrences with constant coefficients, signature (7,-16,12).
Programs
-
Magma
[3,30] cat [128*3^(n-2)-(21*n+57)*2^(n-2): n in [3..30]]; // Vincenzo Librandi, Apr 27 2014
-
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 *)
-
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
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]