A135532 a(n) = 2*a(n-1) + a(n-2), with a(0)= -1, a(1)= 3.
-1, 3, 5, 13, 31, 75, 181, 437, 1055, 2547, 6149, 14845, 35839, 86523, 208885, 504293, 1217471, 2939235, 7095941, 17131117, 41358175, 99847467, 241053109, 581953685, 1404960479, 3391874643, 8188709765, 19769294173, 47727298111, 115223890395, 278175078901, 671574048197
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,1).
Programs
-
Magma
I:=[-1,3]; [n le 2 select I[n] else 2*Self(n-1) + Self(n-2): n in [1..30]]; // G. C. Greubel, May 22 2021
-
Mathematica
LinearRecurrence[{2,1},{-1,3},25] (* G. C. Greubel, Oct 17 2016 *)
-
PARI
a(n)=([0,1; 1,2]^n*[-1;3])[1,1] \\ Charles R Greathouse IV, Oct 17 2016
-
Sage
[(lucas_number2(n,2,-1) + 2*lucas_number2(n-1,2,-1))/2 for n in (0..30)] # G. C. Greubel, May 22 2021
Formula
From R. J. Mathar, Feb 23 2008: (Start)
O.g.f.: (-1 + 5*x)/(1 - 2*x - x^2).
a(n) = ((3+sqrt(2))*(1+sqrt(2))^n + (3-sqrt(2))*(1-sqrt(2))^n)/2 with offset 0. - Al Hakanson (hawkuu(AT)gmail.com), Jun 17 2009
Extensions
More terms from R. J. Mathar, Feb 23 2008
Comments