%I #31 May 30 2023 17:52:39
%S 1,6,21,44,85,138,217,312,441,590,781,996,1261,1554,1905,2288,2737,
%T 3222,3781,4380,5061,5786,6601,7464,8425,9438,10557,11732,13021,14370,
%U 15841,17376,19041,20774,22645,24588,26677,28842,31161,33560,36121,38766,41581,44484
%N Wiener index of the Moebius ladder M(n).
%C The Wiener index of a connected graph is the sum of distances between all unordered pairs of vertices in the graph.
%C Extended to a(1)-a(2) using the formula/recurrence. - _Eric W. Weisstein_, Sep 08 2017
%D N. Biggs, Algebraic Graph Theory, 2nd ed. Cambridge University Press, 1993.
%H Indranil Ghosh, <a href="/A180857/b180857.txt">Table of n, a(n) for n = 1..1000</a> (corrected by Ray Chandler, Jan 19 2019)
%H B. E. Sagan, Y-N. Yeh, and P. Zhang, <a href="http://users.math.msu.edu/users/sagan/Papers/Old/wpg-pub.pdf">The Wiener Polynomial of a Graph</a>, Internat. J. of Quantum Chem., 60, 1996, 959-969.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/MoebiusLadder.html">Moebius Ladder</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/WienerIndex.html">Wiener Index</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).
%F a(n) = Sum_{k>=1} k*A180856(n,k).
%F a(n) = n*(n^2 + 2*n - 2)/2 if n is even;
%F a(n) = n*(n^2 + 2*n - 1)/2 if n is odd.
%F a(n) = n*(-3-(-1)^n+4*n+2*n^2)/4. - _Colin Barker_, Oct 31 2012
%F G.f.: x*(1 + 4 x + 8 x^2 - x^4)/((-1 + x)^4*(1 + x)^2). - _Colin Barker_, Oct 31 2012
%F E.g.f.: x*((2 + 5*x + x^2)*cosh(x) + (1 + 5*x + x^2)*sinh(x))/2. - _Stefano Spezia_, May 30 2023
%e a(4) = 4*(-3-(-1)^4+4*4+2*4^2)/4 = -3-1+16+32 = 44. - _Indranil Ghosh_, Feb 24 2017
%p a := proc (n) if `mod`(n, 2) = 0 then (1/2)*n*(n^2+2*n-2) else (1/2)*n*(n^2+2*n-1) end if end proc: seq(a(n), n = 3 .. 45);
%t (* Start from _Indranil Ghosh_, Feb 24 2017 *)
%t Table[n (-3 - (-1)^n + 4 n + 2 n^2)/4, {n, 40}]
%t CoefficientList[Series[(1 + 4 x + 8 x^2 - x^4)/((-1 + x)^4 (1 + x)^2), {x, 0, 40}], x]
%t LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 6, 21, 44, 85, 138}, 40]
%t (* End *)
%o (PARI) a(n) = n*(-3-(-1)^n+4*n+2*n^2)/4 \\ _Indranil Ghosh_, Feb 24 2017
%o (Python)
%o def A180857(n):
%o return n*(-3-(-1)**n+4*n+2*n**2)//4 # _Indranil Ghosh_, Feb 24 2017
%Y Cf. A180856.
%K nonn,easy
%O 1,2
%A _Emeric Deutsch_, Sep 24 2010
%E a(1)-a(2) from _Eric W. Weisstein_, Sep 08 2017