login
a(n) = 2*a(n-1) + 2*a(n-2) for n > 1; a(0)=2, a(1)=2.
35

%I #93 Mar 02 2024 12:29:16

%S 2,2,8,20,56,152,416,1136,3104,8480,23168,63296,172928,472448,1290752,

%T 3526400,9634304,26321408,71911424,196465664,536754176,1466439680,

%U 4006387712,10945654784,29904084992,81699479552,223207129088,609813217280,1666040692736,4551707820032

%N a(n) = 2*a(n-1) + 2*a(n-2) for n > 1; a(0)=2, a(1)=2.

%C The Lucas sequence V_n(2,-2). - _Jud McCranie_, Mar 02 2012

%C The signed version 2, -2, 8, -20, 56, -152, 416, -1136, 3104, -8480, 23168, ... is the Lucas sequence V(-2,-2). - _R. J. Mathar_, Jan 08 2013

%C After a(2) equals round((1+sqrt(3))^n) = 1, 3, 7, 20, 56, 152, ... - _Jeremy Gardiner_, Aug 11 2013

%C Also the number of independent vertex sets and vertex covers in the n-sunlet graph. - _Eric W. Weisstein_, Sep 27 2017

%H Reinhard Zumkeller, <a href="/A080040/b080040.txt">Table of n, a(n) for n = 0..1000</a>

%H I. Amburg, K. Dasaratha, L. Flapan, T. Garrity, C. Lee, C. Mihailak, N. Neumann-Chun, S. Peluse, and M. Stoffregen, <a href="http://arxiv.org/abs/1509.05239">Stern Sequences for a Family of Multidimensional Continued Fractions: TRIP-Stern Sequences</a>, arXiv:1509.05239v1 [math.CO], 2015-2017.

%H Martin Burtscher, Igor Szczyrba, and Rafał Szczyrba, <a href="http://www.emis.de/journals/JIS/VOL18/Szczyrba/sz3.html">Analytic Representations of the n-anacci Constants and Generalizations Thereof</a>, Journal of Integer Sequences, Vol. 18 (2015), Article 15.4.5.

%H D. Jhala, G. P. S. Rathore, and K. Sisodiya, <a href="http://dx.doi.org/10.12691/tjant-2-4-3">Some Properties of k-Jacobsthal Numbers with Arithmetic Indexes</a>, Turkish Journal of Analysis and Number Theory, 2014, Vol. 2, No. 4, 119-124.

%H Tanya Khovanova, <a href="http://www.tanyakhovanova.com/RecursiveSequences/RecursiveSequences.html">Recursive Sequences</a>

%H D. H. Lehmer, <a href="https://doi.org/10.1112/jlms/s1-10.2.162">On Lucas's test for the primality of Mersenne's numbers</a>, Journal of the London Mathematical Society 1.3 (1935): 162-165. See V_n.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/IndependentVertexSet.html">Independent Vertex Set</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SunletGraph.html">Sunlet Graph</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/VertexCover.html">Vertex Cover</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,2).

%H <a href="/index/Lu#Lucas">Index entries for Lucas sequences</a> (2,-2).

%F G.f.: (2-2*x)/(1-2*x-2*x^2).

%F a(n) = (1+sqrt(3))^n + (1-sqrt(3))^n.

%F a(n) = 2*A026150(n). - _Philippe Deléham_, Nov 19 2008

%F G.f.: G(0), where G(k) = 1 + 1/(1 - x*(3*k-1)/(x*(3*k+2) - 1/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Jun 11 2013

%F a(n) = 2*2^floor(n/2)*A002531(n). - _Ralf Stephan_, Sep 08 2013

%F a(n) = [x^n] ( 1 + x + sqrt(1 + 2*x + 3*x^2) )^n for n >= 1. - _Peter Bala_, Jun 29 2015

%F E.g.f.: 2*exp(x)*cosh(sqrt(3)*x). - _Stefano Spezia_, Mar 02 2024

%t CoefficientList[Series[(2 - 2 t)/(1 - 2 t - 2 t^2), {t, 0, 30}], t]

%t With[{c = {2, 2}}, LinearRecurrence[c, c, 20]] (* _Harvey P. Dale_, Apr 24 2016 *)

%t Round @ Table[LucasL[n, Sqrt[2]] 2^(n/2), {n, 0, 20}] (* _Vladimir Reshetnikov_, Sep 15 2016 *)

%t Table[(1 - Sqrt[3])^n + (1 + Sqrt[3])^n, {n, 0, 20}] // Expand (* _Eric W. Weisstein_, Sep 27 2017 *)

%o (Sage) from sage.combinat.sloane_functions import recur_gen2b; it = recur_gen2b(2,2,2,2, lambda n: 0); [next(it) for i in range(27)] # _Zerinvary Lajos_, Jul 16 2008

%o (Sage) [lucas_number2(n,2,-2) for n in range(0, 27)] # _Zerinvary Lajos_, Apr 30 2009

%o (Haskell)

%o a080040 n = a080040_list !! n

%o a080040_list =

%o 2 : 2 : map (* 2) (zipWith (+) a080040_list (tail a080040_list))

%o -- _Reinhard Zumkeller_, Oct 15 2011

%o (PARI) a(n)=([0,1; 2,2]^n*[2;2])[1,1] \\ _Charles R Greathouse IV_, Apr 08 2016

%o (Magma) a:=[2,2]; [n le 2 select a[n] else 2*Self(n-1) + 2*Self(n-2):n in [1..27]]; _Marius A. Burtea_, Jan 20 2020

%o (Magma) R<x>:=PowerSeriesRing(Rationals(), 27); Coefficients(R!( (2-2*x)/(1-2*x-2*x^2))); // _Marius A. Burtea_, Jan 20 2020

%Y Cf. A002531, A002605, A028859, A030195, A083337, A106435, A108898, A125145.

%Y Equals 2*A026150.

%K easy,nonn

%O 0,1

%A Mario Catalani (mario.catalani(AT)unito.it), Jan 21 2003