A157240 a(n) = A128018(n) + 1.
2, -1, -7, -7, 17, 65, 65, -127, -511, -511, 1025, 4097, 4097, -8191, -32767, -32767, 65537, 262145, 262145, -524287, -2097151, -2097151, 4194305, 16777217, 16777217, -33554431, -134217727, -134217727, 268435457, 1073741825
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,-6,4).
Programs
-
Mathematica
LinearRecurrence[{3,-6,4},{2,-1,-7},40] (* Harvey P. Dale, May 30 2021 *)
-
PARI
Vec((2 - 7*x + 8*x^2) / ((1 - x)*(1 - 2*x + 4*x^2)) + O(x^35)) \\ Colin Barker, May 22 2019
Formula
G.f.: (2-7*x+8*x^2) / ((1-x)*(4*x^2-2*x+1)).
From Colin Barker, May 22 2019: (Start)
a(n) = (2 + (1-i*sqrt(3))^(1+n) + (1+i*sqrt(3))^(1+n)) / 2 where i=sqrt(-1).
a(n) = 3*a(n-1) - 6*a(n-2) + 4*a(n-3) for n>2.
(End)
a(n) = A138230(n+1)+1. - R. J. Mathar, Sep 11 2019
Comments