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

%I #31 Jun 15 2023 14:46:18

%S 1,0,3,4,11,20,43,84,171,340,683,1364,2731,5460,10923,21844,43691,

%T 87380,174763,349524,699051,1398100,2796203,5592404,11184811,22369620,

%U 44739243,89478484,178956971,357913940,715827883,1431655764,2863311531,5726623060,11453246123

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

%H G. C. Greubel, <a href="/A097072/b097072.txt">Table of n, a(n) for n = 0..1000</a>

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

%F a(n) = (4*2^n - 3 + 5*(-1)^n)/6.

%F a(n) = Sum_{k=0..n} (2^k - 1 + 0^k)(-1)^(n-k).

%F a(n) = A001045(n+1) - A000035(n).

%F a(n) = a(n-1) + 2*a(n-2) + 1, n > 1. - _Gary Detlefs_, Jun 20 2010

%F a(2*n) = A007583(n), a(2*n+1) = A080674(n), n >= 0. - _Yosu Yurramendi_, Feb 21 2017

%F a(n) = A000975(n) + (-1)^n. - _Alois P. Heinz_, Jun 15 2023

%p a:= n-> ceil(2*(2^n-1)/3)+(-1)^n:

%p seq(a(n), n=0..32); # _Alois P. Heinz_, Jun 15 2023

%t CoefficientList[Series[(1-2x+2x^2)/((1-x^2)(1-2x)),{x,0,50}],x] (* _Harvey P. Dale_, Mar 09 2011 *)

%t Table[2*2^n/3 - 1/2 + 5 (-1)^n/6, {n, 0, 32}] (* _Michael De Vlieger_, Feb 22 2017 *)

%o (PARI) for(n=0,50, print1((4*2^n - 3 + 5*(-1)^n)/6, ", ")) \\ _G. C. Greubel_, Oct 10 2017

%o (Magma) [(4*2^n - 3 + 5*(-1)^n)/6: n in [0..50]]; // _G. C. Greubel_, Oct 10 2017

%Y Cf. A000035, A000975, A001045, A007583, A080674.

%K easy,nonn

%O 0,3

%A _Paul Barry_, Jul 22 2004