A152732 a(n) + a(n+1) + a(n+2) = 2^n.
0, 0, 2, 2, 4, 10, 18, 36, 74, 146, 292, 586, 1170, 2340, 4682, 9362, 18724, 37450, 74898, 149796, 299594, 599186, 1198372, 2396746, 4793490, 9586980, 19173962, 38347922, 76695844, 153391690, 306783378, 613566756, 1227133514, 2454267026, 4908534052
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,1,2).
Programs
-
Magma
I:=[0,0,2]; [n le 3 select I[n] else Self(n-1) +Self(n-2) +2*Self(n-3): n in [1..30]]; // G. C. Greubel, Sep 01 2018
-
Mathematica
k0=k1=0;lst={k0,k1};Do[kt=k1;k1=2^n-k1-k0;k0=kt;AppendTo[lst,k1],{n,1,5!}];lst LinearRecurrence[{1, 1, 2}, {0, 0, 2}, 70] (* Vladimir Joseph Stephan Orlovsky, Feb 24 2012 *)
-
PARI
concat([0,0],Vec(2/(1-2*x)/(1+x+x^2)+O(x^99))) \\ Charles R Greathouse IV, Feb 24 2012
Formula
From R. J. Mathar, Dec 12 2008: (Start)
a(n) = 2*A077947(n-3).
G.f.: 2*x^3/((1-2*x)*(1+x+x^2)). (End)
a(n) = (1/21)*(3*2^n + 18*cos((2*n*Pi)/3) + 2*sqrt(3)*sin((2*n*Pi)/3)). - Zak Seidov, Dec 12 2008
Comments