%I #9 Sep 08 2017 09:33:09
%S 0,6,52,228,708,1778,3864,7560,13656,23166,37356,57772,86268,125034,
%T 176624,243984,330480,439926,576612,745332,951412,1200738,1499784,
%U 1855640,2276040,2769390,3344796,4012092,4781868,5665498,6675168,7823904,9125600,10595046
%N Wiener index of the n X n king graph.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/KingGraph.html">King Graph</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 (6,-15,20,-15,6,-1).
%F a(n) = (n - 1)*n*(n + 1)*(7*n^2 + 2)/30.
%F a(n) = 6*a(n-1) - 15*a(n-2) + 20*a(n-3) - 15*a(n-4) + 6*a(n-5) - a(n-6).
%F G.f.: 2*x^2*(3 + 8*x + 3*x^2)/(1 - x)^6.
%t Table[(n - 1) n (n + 1) (7 n^2 + 2)/30, {n, 40}]
%t LinearRecurrence[{6, -15, 20, -15, 6, -1}, {0, 6, 52, 228, 708, 1778}, 20]
%t CoefficientList[Series[2 x (3 + 8 x + 3 x^2)/(1 - x)^6, {x, 0, 20}], x]
%K nonn,easy
%O 1,2
%A _Eric W. Weisstein_, Sep 08 2017