OFFSET
3,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 3..1000
S. Klavzar, A. Rajapakse, and I. Gutman, The Szeged and the Wiener index of graphs, Appl. Math. Lett., 9, 1996, 45-49.
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
a(n) = 3n^3 if n is even; a(n) = 3n^3 - 4n^2 + 2n if n is odd. Follows from Theorem 2.1 of the Klavzar et al. reference.
G.f.: -x^3*(24*x^6-23*x^5-73*x^4+60*x^3+60*x^2-141*x-51) / ((x-1)^4*(x+1)^3). - Colin Barker, Aug 07 2014
EXAMPLE
a(3)=51; indeed, C_3 X P_2 consists of 2 concentric triangles abc, ABC, and the additional edges aA, bB, and cC. Each of the six edges of the two triangles contributes 2*2 = 4 and each of the three edges aA, bB, cC contributes 3*3=9; now, 6*4 + 3*9 = 51.
MAPLE
a:=proc (n) if `mod`(n, 2) = 0 then 3*n^3 else 3*n^3-4*n^2+2*n end if end proc: seq(a(n), n=3..40);
MATHEMATICA
CoefficientList[Series[-(24 x^6 - 23 x^5 - 73 x^4 + 60 x^3 + 60 x^2 - 141 x - 51)/((x - 1)^4 (x + 1)^3), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 07 2014 *)
PROG
(PARI) Vec(-x^3*(24*x^6-23*x^5-73*x^4+60*x^3+60*x^2-141*x-51)/((x-1)^4*(x+1)^3) + O(x^100)) \\ Colin Barker, Aug 07 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Emeric Deutsch, Aug 06 2014
STATUS
approved