%I #21 May 18 2018 08:47:37
%S 0,0,1,0,1,2,5,8,17,34,69,136,273,546,1093,2184,4369,8738,17477,34952,
%T 69905,139810,279621,559240,1118481,2236962,4473925,8947848,17895697,
%U 35791394,71582789,143165576,286331153,572662306,1145324613,2290649224
%N a(0)=0; a(n+1) = 2*a(n) + period 4:repeat 0,1,-2,1.
%C (**) See A115451, A139763, A139800, A139806, A139814.
%C a(n) + a(n+1) + a(n+2) + a(n+3) = 2^n.
%H <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,1,2).
%F a(n) = a(n-4) + 2^(n-4).
%F a(n) = -a(n-2) + A078008(n).
%F a(n) = a(n-2) + A118405(n-2) unsigned.
%F a(n) = a(n-1) + a(n-2) + a(n-3) + 2*a(n-4) (**).
%F G.f. x^2*(-1+x) / ( (2*x-1)*(1+x)*(x^2+1) ). - _R. J. Mathar_, Feb 06 2011
%e a(1)=2*a(0)+0=0, a(2)=2*a(1)+1=0+1=1, a(3)=2*a(2)-2=2-2=0, a(4)=2*a(3)+1=0+1=1, a(5)=2*a(4)+0=2+0=2, a(6)=2*a(5)+1=4+1=5.
%p a:= proc(n) option remember;
%p `if`(n=0, 0, 2*a(n-1) +[0, 1, -2, 1][irem(n-1, 4)+1])
%p end:
%p seq(a(n), n=0..40); # _Alois P. Heinz_, Jan 30 2011
%t LinearRecurrence[{1, 1, 1, 2}, {0, 0, 1, 0}, 40] (* _Jean-François Alcover_, May 18 2018 *)
%Y Cf. A180343.
%K nonn,easy
%O 0,6
%A _Paul Curtz_, Jan 30 2011