This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A304159 #40 May 28 2025 01:13:14 %S A304159 2,10,34,86,178,322,530,814,1186,1658,2242,2950,3794,4786,5938,7262, %T A304159 8770,10474,12386,14518,16882,19490,22354,25486,28898,32602,36610, %U A304159 40934,45586,50578,55922,61630,67714,74186,81058,88342,96050,104194,112786,121838,131362,141370,151874,162886,174418,186482,199090 %N A304159 a(n) = 2*n^3 - 4*n^2 + 6*n - 2 (n>=1). %C A304159 a(n) is the first Zagreb index of the Barbell graph B(n) (n>=3). %C A304159 The Barbell graph B(n) is defined as two copies of the complete graph K(n) (n>=3), connected by a bridge. %C A304159 The first Zagreb index of a simple connected graph is the sum of the squared degrees of its vertices. Alternatively, it is the sum of the degree sums d(i) + d(j) over all edges ij of the graph. %C A304159 The M-polynomial of the Barbell graph B(n) is M(B(n),x,y) = (n-1)*(n-2)*x^{n-1}*y^{n-1} + 2*(n-1)*x^{n-1}*y^n + x^n*y^n. %H A304159 Colin Barker, <a href="/A304159/b304159.txt">Table of n, a(n) for n = 1..1000</a> %H A304159 Emeric Deutsch and Sandi Klavžar, <a href="https://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 A304159 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/BarbellGraph.html">Barbell Graph</a> %H A304159 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1). %F A304159 a(n) = 2 * A100705(n-1). %F A304159 From _Colin Barker_, May 09 2018: (Start) %F A304159 G.f.: 2*x*(1 + x + 3*x^2 + x^3) / (1 - x)^4. %F A304159 a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n>4. (End) %F A304159 a(n) = A033431(n) - A002943(n-1) = A033431(n) - 2*A014105(n-1). - _Omar E. Pol_, May 09 2018 %p A304159 seq(2*n^3-4*n^2+6*n-2, n = 1 .. 40); %t A304159 Table[2n^3-4n^2+6n-2 ,{n,50}] (* or *) LinearRecurrence[{4,-6,4,-1},{2,10,34,86},50] (* _Harvey P. Dale_, Mar 05 2023 *) %o A304159 (PARI) Vec(2*x*(1 + x + 3*x^2 + x^3) / (1 - x)^4 + O(x^60)) \\ _Colin Barker_, May 09 2018 %o A304159 (PARI) a(n) = 2*n^3-4*n^2+6*n-2; \\ _Altug Alkan_, May 09 2018 %Y A304159 Cf. A002943, A014105, A033431, A100705, A304160. %K A304159 nonn,easy %O A304159 1,1 %A A304159 _Emeric Deutsch_, May 09 2018