A136258 a(n) = 2*a(n-1) - 2*a(n-2), with a(0)=1, a(1)=5.
1, 5, 8, 6, -4, -20, -32, -24, 16, 80, 128, 96, -64, -320, -512, -384, 256, 1280, 2048, 1536, -1024, -5120, -8192, -6144, 4096, 20480, 32768, 24576, -16384, -81920, -131072, -98304, 65536, 327680, 524288, 393216, -262144, -1310720, -2097152, -1572864, 1048576
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,-2).
Programs
-
Magma
[n le 2 select 5^(n-1) else 2*(Self(n-1) - Self(n-2)): n in [1..41]]; // G. C. Greubel, Dec 02 2021
-
Mathematica
LinearRecurrence[{2,-2},{1,5},50] (* Harvey P. Dale, May 21 2014 *)
-
PARI
vector(100,n,t=if(n<3,[t1=1,5][n],-2*t1+2*t1=t)) \\ M. F. Hasler, May 01 2008
-
Sage
A136258=BinaryRecurrenceSequence(2,-2,1,5) [A136258(n) for n in (0..40)] # G. C. Greubel, Dec 02 2021
Formula
a(4n+1) = 5*(-4)^n, a(4n+3) = 6*(-4)^n. - M. F. Hasler, May 01 2008
G.f.: x*(1+3*x)/(1-2*x+2*x^2). - R. J. Mathar, Feb 22 2009
From Paul Curtz, Apr 27 2011: (Start)
a(n)= -4 * a(n-4).
E.g.f.: exp(x)*( cos(x) + 4*sin(x) ). - G. C. Greubel, Dec 02 2021
Extensions
Edited and extended by M. F. Hasler, May 01 2008
Offset corrected Paul Curtz, Apr 27 2011
Comments