login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Expansion of 1/((1 - 2*x + 2*x^2)*(1-x)).
4

%I #56 Jan 03 2025 13:31:29

%S 1,3,5,5,1,-7,-15,-15,1,33,65,65,1,-127,-255,-255,1,513,1025,1025,1,

%T -2047,-4095,-4095,1,8193,16385,16385,1,-32767,-65535,-65535,1,131073,

%U 262145,262145,1,-524287,-1048575,-1048575,1,2097153,4194305,4194305,1,-8388607,-16777215,-16777215

%N Expansion of 1/((1 - 2*x + 2*x^2)*(1-x)).

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-4,2).

%F a(n) = 1-A146559(n+2). a(n)= 3*a(n-1) -4*a(n-2) +2*a(n-3). - _R. J. Mathar_, Jan 18 2011

%F G.f.: Q(0) where Q(k) = 1 + k*(2*x+1) + 8*x - 2*x*(k+1)*(k+5)/Q(k+1); (continued fraction). - _Sergei N. Gladkovskii_, Mar 14 2013

%F G.f.: G(0)/(2*(1-x)^2), where G(k)= 1 + 1/(1 - x*(k+1)/(x*(k+2) + 1/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, May 25 2013

%F a(n) = Sum_{k=0..n} ((-1)^k*2^(n-k)*binomial(n-k-1,k)). - _Vladimir Kruchinin_, Jul 02 2015

%F a(n) = 1 + 2^(1 + n/2)*sin((n*Pi)/4). - _Jean-François Alcover_, Jul 02 2015

%F a(n) = 1 + 2*Im((1 + i)^n), where i is the imaginary unit. - _Daniel Suteu_, Dec 21 2018

%F a(n) = Sum_{k=0..floor(n/2)} (-1)^k*binomial(n+2,2*k+2). - _Taras Goy_, Jan 03 2025

%F E.g.f.: exp(x)*(1 + 2*sin(x)). - _Stefano Spezia_, Jan 03 2025

%t Join[{a=1,b=3},Table[c=2*b-2*a+1;a=b;b=c,{n,100}]] (* _Vladimir Joseph Stephan Orlovsky_, Jan 17 2011 *)

%t CoefficientList[Series[1/((1-2x+2x^2)(1-x)),{x,0,60}],x] (* or *) LinearRecurrence[{3,-4,2},{1,3,5},60] (* _Harvey P. Dale_, Feb 01 2013 *)

%o (PARI) Vec(1/((1-2*x+2*x^2)*(1-x))+O(x^99)) \\ _Charles R Greathouse IV_, Sep 26 2012

%o (PARI) a(n) = 1 + 2*imag((1 + I)^n); \\ _Daniel Suteu_, Dec 21 2018

%o (Maxima) a(n):=sum((-1)^k*2^(n-k)*binomial(n-k-1,k),k,0,n); /* _Vladimir Kruchinin_, Jul 02 2015 */

%o (Magma) I:=[1,3,5]; [n le 3 select I[n] else 3*Self(n-1)-4*Self(n-2)+2*Self(n-3): n in [1..60]]; // _Vincenzo Librandi_, Jul 02 2015

%K sign,easy,changed

%O 0,2

%A _N. J. A. Sloane_, Nov 17 2002