A137255 a(n) = 2*a(n-1) + 4*a(n-2) - 6*a(n-3) - 3*a(n-4) for n > 3, with a(0)=1, a(1)=2, a(2)=4, a(3)=8.
1, 2, 4, 8, 17, 36, 80, 178, 409, 942, 2212, 5204, 12377, 29472, 70592, 169198, 406801, 978426, 2357092, 5679488, 13696385, 33032892, 79703120, 192321034, 464168041, 1120302822, 2704242244, 6527724428, 15758096777, 38040729336, 91834772480
Offset: 0
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,4,-6,-3).
Programs
-
Magma
R
:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-4*x^2-2*x^3)/(1-2*x-4*x^2+6*x^3+3*x^4) )); // G. C. Greubel, Apr 11 2021 -
Maple
a:=proc(n) options operator, arrow: expand((3/8)*3^((1/2)*n)*(1+(-1)^n)+(5/24)*3^((1/2)*n+1/2)*(1-(-1)^n)+(1/8)*(1+sqrt(2))^(n+1)+(1/8)*(1-sqrt(2))^(n+1)) end proc: seq(a(n),n=0..30); # Emeric Deutsch, Mar 31 2008
-
Mathematica
LinearRecurrence[{2,4,-6,-3},{1,2,4,8},40] (* or *) CoefficientList[ Series[ (1-4 x^2-2 x^3)/(1-2 x-4 x^2+6 x^3+3 x^4),{x,0,40}],x] (* Harvey P. Dale, May 03 2018 *)
-
Sage
def A137255_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P( (1-4*x^2-2*x^3)/(1-2*x-4*x^2+6*x^3+3*x^4) ).list() A137255_list(40) # G. C. Greubel, Apr 11 2021
Formula
a(n) = (3/8)*3^(n/2)*(1 + (-1)^n) + (5/24)*3^((n+1)/2)*(1 - (-1)^n) + (1/8)*(1+sqrt(2))^(n+1) + (1/8)*(1-sqrt(2))^(n+1). - Emeric Deutsch, Mar 31 2008
G.f.: (1 - 4*x^2 - 2*x^3)/(( 1 -3*x^2) *(1 -2*x -x^2)). - Harvey P. Dale, May 03 2018
Extensions
More terms from Emeric Deutsch, Mar 31 2008