OFFSET
3,1
COMMENTS
The n X n torus grid graph is Hamilton-connected for odd n, giving a(n) = n^2*(n^2 - 1)^2/2 for odd n.
LINKS
Colin Barker, Table of n, a(n) for n = 3..1000
Eric Weisstein's World of Mathematics, Detour Index
Eric Weisstein's World of Mathematics, Torus Grid Graph
Index entries for linear recurrences with constant coefficients, signature (2,4,-10,-5,20,0,-20,5,10,-4,-2,1).
FORMULA
a(n) = n^2*(n^2 - 1)^2/2 for odd n.
a(n) = A296779(n) = n^2*(2*n^4 - 5*n^2 + 4)/4 for even n. - Andrew Howroyd, Dec 21 2017
From Colin Barker, Dec 21 2017: (Start)
G.f.: 16*x^3*(18 + 73*x + 160*x^2 + 203*x^3 + 190*x^4 + 69*x^5 - 4*x^6 + 6*x^7 + 10*x^8 - 4*x^9 - 2*x^10 + x^11) / ((1 - x)^7*(1 + x)^5).
a(n) = 2*a(n-1) + 4*a(n-2) - 10*a(n-3) - 5*a(n-4) + 20*a(n-5) - 20*a(n-7) + 5*a(n-8) + 10*a(n-9) - 4*a(n-10) - 2*a(n-11) + a(n-12) for n>14.
(End)
MATHEMATICA
a[n_] := If[OddQ[n], (1/2)*n^2*(n^2 - 1)^2, (1/4)*n^2*(2*n^4 - 5*n^2 + 4)]; Table[a[n], {n, 3, 30}] (* Jean-François Alcover, Dec 21 2017, after Andrew Howroyd *)
LinearRecurrence[{2, 4, -10, -5, 20, 0, -20, 5, 10, -4, -2, 1}, {288, 1744, 7200, 21744, 56448, 126016, 259200, 487600, 871200, 1467216, 2384928, 3716944}, 20] (* Eric W. Weisstein, Dec 21 2017 *)
CoefficientList[Series[(16 (18 + 73 x + 160 x^2 + 203 x^3 + 190 x^4 + 69 x^5 - 4 x^6 + 6 x^7 + 10 x^8 - 4 x^9 - 2 x^10 + x^11))/((1 - x)^7 (1 + x)^5), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 21 2017 *)
PROG
(PARI) a(n) = n^2 * if(n%2, (n^2 - 1)^2/2, (2*n^4 - 5*n^2 + 4)/4); \\ Andrew Howroyd, Dec 21 2017
(PARI) Vec(16*x^3*(18 + 73*x + 160*x^2 + 203*x^3 + 190*x^4 + 69*x^5 - 4*x^6 + 6*x^7 + 10*x^8 - 4*x^9 - 2*x^10 + x^11) / ((1 - x)^7*(1 + x)^5) + O(x^40)) \\ Colin Barker, Dec 21 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Eric W. Weisstein, Dec 20 2017
EXTENSIONS
Terms a(8) and beyond from Andrew Howroyd, Dec 21 2017
STATUS
approved