A097074 Expansion of (1-x+2*x^2)/((1-x)*(1-x-2*x^2)).
1, 1, 5, 9, 21, 41, 85, 169, 341, 681, 1365, 2729, 5461, 10921, 21845, 43689, 87381, 174761, 349525, 699049, 1398101, 2796201, 5592405, 11184809, 22369621, 44739241, 89478485, 178956969, 357913941, 715827881, 1431655765, 2863311529
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Wolfdieter Lang, Notes on certain inhomogeneous three term recurrences. [_Wolfdieter Lang_, Oct 18 2010]
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
Programs
-
Magma
[(2^(n+2) +2*(-1)^n -3)/3: n in [0..40]]; // G. C. Greubel, Aug 18 2022
-
Mathematica
CoefficientList[Series[(1-x+2x^2)/((1-x)(1-x-2x^2)),{x,0,40}],x] (* or *) LinearRecurrence[{2,1,-2},{1,1,5},40] (* Harvey P. Dale, Apr 09 2018 *)
-
SageMath
[(2^(n+2) +2*(-1)^n -3)/3 for n in (0..40)] # G. C. Greubel, Aug 18 2022
Formula
a(n) = 2*A001045(n+1) - 1.
a(n) = (2^(n+2) + 2*(-1)^n - 3)/3.
From Wolfdieter Lang, Oct 18 2010: (Start)
a(n) = a(n-1) + 2*a(n-2) + 2, a(0)=1, a(1)=1.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), a(0)=1=a(1), a(2)=5. Observed by G. Detlefs. See the W. Lang link. (End)
a(n) = 3*a(n-1) - 2*a(n-2) + 4*(-1)^n. - Gary Detlefs, Dec 19 2010
E.g.f.: (1/3)*(2*exp(-x) - 3*exp(x) + 4*exp(2*x)). - G. C. Greubel, Aug 18 2022
Extensions
Correction of the homogeneous recurrence and index link added by Wolfdieter Lang, Nov 16 2013
Comments