A135530 a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3), with a(0)=2, a(1)=1.
2, 1, 4, 2, 8, 4, 16, 8, 32, 16, 64, 32, 128, 64, 256, 128, 512, 256, 1024, 512, 2048, 1024, 4096, 2048, 8192, 4096, 16384, 8192, 32768, 16384, 65536, 32768, 131072, 65536, 262144, 131072, 524288, 262144, 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 (0,2).
Programs
-
Mathematica
CoefficientList[Series[(-x-2)/(2x^2-1),{x,0,40}],x] Transpose[NestList[{#[[2]],Last[#],Last[#]+2#[[2]]-2First[#]}&,{2,1,4},45]][[1]] (* Harvey P. Dale, Mar 05 2011 *) LinearRecurrence[{0, 2}, {2, 1}, 25] (* G. C. Greubel, Oct 17 2016 *)
-
PARI
a(n)=1<<(1-n%2+n\2) \\ Charles R Greathouse IV, Jun 01 2011
Formula
From R. J. Mathar, Feb 23 2008: (Start)
O.g.f.: -(2+x)/(2*x^2-1).
a(n) = 2*a(n-2).
E.g.f.: (1/sqrt(2))*( 2*sqrt(2)*cosh(sqrt(2)*x) + sinh(sqrt(2)*x) ). - G. C. Greubel, Oct 17 2016
a(n) = A076736(n+4) for n >= 0. - Georg Fischer, Nov 03 2018
From Amiram Eldar, Feb 02 2024: (Start)
Sum_{n>=0} 1/a(n) = 3.
Sum_{n>=0} (-1)^(n+1)/a(n) = 1. (End)
Extensions
More terms from R. J. Mathar, Feb 23 2008