%I #61 Sep 08 2022 08:45:53
%S 1,0,6,2,26,10,106,42,426,170,1706,682,6826,2730,27306,10922,109226,
%T 43690,436906,174762,1747626,699050,6990506,2796202,27962026,11184810,
%U 111848106,44739242,447392426,178956970,1789569706,715827882,7158278826
%N a(n) = 2^(n-1) - (2^n*(-1)^n + 2)/3.
%C The ratio a(n+1)/a(n) approaches 10 for even n and 2/5 for odd n as n->infinity.
%H G. C. Greubel, <a href="/A176965/b176965.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,4,-4).
%F From _R. J. Mathar_, Apr 30 2010: (Start)
%F a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
%F G.f.: x*(1 - x + 2*x^2)/( (1-x)*(1+2*x)*(1-2*x) ). (End)
%F a(n) = A087231(n), n > 2. - _R. J. Mathar_, May 03 2010
%F a(2n-1) = A061547(2n), a(2n) = A061547(2n-1), n > 0. - _Yosu Yurramendi_, Dec 23 2016
%F a(n+1) = 2*A096773(n), n > 0. - _Yosu Yurramendi_, Dec 30 2016
%F a(2n-1) = A020989(n-1), a(2n) = A020988(n-1), n > 0. - _Yosu Yurramendi_, Jan 03 2017
%F a(2n-1) = (A083597(n-1) + A000302(n-1))/2, a(2n) = (A083597(n-1) - A000302(n-1))/2, n > 0. - _Yosu Yurramendi_, Mar 04 2017
%F a(n+2) = 4*a(n) + 2, a(1) = 1, a(2) = 0, n > 0. - _Yosu Yurramendi_, Mar 07 2017
%F a(n) = (-16 + (9 - (-1)^n) * 2^(n - (-1)^n))/24. - _Loren M. Pearson_, Dec 28 2019
%F E.g.f.: (3*exp(2*x) - 4*exp(x) + 3 - 2*exp(-2*x))/6. - _G. C. Greubel_, Dec 28 2019
%F a(n) = (2^n*5^(n mod 2) - 4)/6. - _Heinz Ebert_, Jun 29 2021
%p seq( (3*2^(n-1) -(-2)^n -2)/3, n=1..30); # _G. C. Greubel_, Dec 28 2019
%t a[n_]:= a[n]= 2^(n-1)*If[n==1, 1, a[n-1]/2 +(-1)^(n-1)*Sqrt[(5 +4*(-1)^(n-1) )]/2]; Table[a[n], {n,30}]
%t LinearRecurrence[{1,4,-4}, {1,0,6}, 30] (* _G. C. Greubel_, Dec 28 2019 *)
%o (PARI) vector(30, n, (3*2^(n-1) -(-2)^n -2)/3 ) \\ _G. C. Greubel_, Dec 28 2019
%o (Magma) [(3*2^(n-1) -(-2)^n -2)/3: n in [1..30]]; // _G. C. Greubel_, Dec 28 2019
%o (Sage) [(3*2^(n-1) -(-2)^n -2)/3 for n in (1..30)] # _G. C. Greubel_, Dec 28 2019
%o (GAP) List([1..30], n-> (3*2^(n-1) -(-2)^n -2)/3); # _G. C. Greubel_, Dec 28 2019
%Y Merger of A020988 (even n) and A020989 (odd n).
%K nonn,easy
%O 1,3
%A _Roger L. Bagula_, Apr 29 2010