%I #20 May 11 2018 03:08:19
%S 5,19,65,185,445,935,1769,3085,5045,7835,11665,16769,23405,31855,
%T 42425,55445,71269,90275,112865,139465,170525,206519,247945,295325,
%U 349205,410155,478769,555665,641485,736895,842585,959269,1087685,1228595,1382785
%N a(n) = n^4 - 3*n^3 + 9*n^2 - 7*n + 5 (n>=1).
%C For n>=2, a(n) is the second Zagreb index of the graph KK_n, defined as 2 copies of the complete graph K_n, with one vertex from one copy joined to two vertices of the other copy (see the Stevanovic et al. reference, p. 396).
%C The second Zagreb index of a simple connected graph is the sum of the degree products d(i)d(j) over all edges ij of the graph.
%C The M-polynomial of KK_n is M(KK_n; x,y) = (n-2)^2*x^(n-1)*y^(n-1) + 2*(n-2)*x^(n-1)*y^n + (n-1)*x^(n-1)*y^(n+1) + x^n*y^n + 2*x^n*y^(n+1).
%H Colin Barker, <a href="/A304162/b304162.txt">Table of n, a(n) for n = 1..1000</a>
%H E. Deutsch and Sandi Klavzar, <a href="http://dx.doi.org/10.22052/ijmc.2015.10106">M-polynomial and degree-based topological indices</a>, Iranian J. Math. Chemistry, 6, No. 2, 2015, 93-102.
%H D. Stevanovic, I. Stankovic, and M. Milosevic, <a href="http://match.pmf.kg.ac.rs/electronic_versions/Match61/n2/match61n2_395-401.pdf">More on the relation between energy and Laplacian energy of graphs</a>, MATCH Commun. Math. Comput. Chem. 61, 2009, 395-401.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).
%F From _Colin Barker_, May 10 2018: (Start)
%F G.f.: x*(5 - 6*x + 20*x^2 + 5*x^4) / (1 - x)^5.
%F a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5) for n>5.
%F (End)
%p seq(n^4-3*n^3+9*n^2-7*n+5, n = 1 .. 40);
%t Table[n (n - 1) (n^2 - 2 n + 7) + 5, {n, 1, 40}] (* _Bruno Berselli_, May 10 2018 *)
%o (PARI) Vec(x*(5 - 6*x + 20*x^2 + 5*x^4) / (1 - x)^5 + O(x^60)) \\ _Colin Barker_, May 10 2018
%o (GAP) List([1..40],n->n^4-3*n^3+9*n^2-7*n+5); # _Muniru A Asiru_, May 10 2018
%Y Cf. A304161.
%K nonn,easy
%O 1,1
%A _Emeric Deutsch_, May 10 2018