A171382 a(n) = (2*2^n+7*(-1)^n)/3.
3, -1, 5, 3, 13, 19, 45, 83, 173, 339, 685, 1363, 2733, 5459, 10925, 21843, 43693, 87379, 174765, 349523, 699053, 1398099, 2796205, 5592403, 11184813, 22369619, 44739245, 89478483, 178956973, 357913939, 715827885, 1431655763, 2863311533
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (1,2).
Crossrefs
Programs
-
Magma
[ (2*2^n+7*(-1)^n)/3: n in [0..32] ];
-
Mathematica
Nest[Append[#,Last[#]+2#[[-2]]]&,{3,-1},40] (* Harvey P. Dale, Apr 07 2011 *)
Formula
a(n) = a(n-1)+2*a(n-2) for n > 1; a(0) = 3, a(1) = -1.
a(n) = 2^n-a(n-1) for n > 0; a(0) = 3.
G.f.: (3-4*x)/((1+x)*(1-2*x)).
Comments