%I #33 Aug 07 2017 03:39:28
%S 1,0,1,1,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,
%T 1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0
%N A run of 2^n 1's followed by a run of 2^n 0's, for n=0, 1, 2, ...
%C First differences of A006165 and, likely, of A078881.
%H Robert Israel, <a href="/A086694/b086694.txt">Table of n, a(n) for n = 1..10000</a>
%H R. Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences ...</a>
%H R. Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>
%F a(n) = 1-A079944(n-1) = 2-A079882(n-1) = A080791(n+1)-A083661(n+1).
%F a(n) = 1 - floor(log_2(4*(n+1)/3)) + floor(log_2(n+1)).
%F a(1) = 1, a(2) = 0, a(2n+1) = a(n), a(2n) = a(n-1).
%F G.f.: Sum_{k>=1} (x^(2^k)-x^(3*2^(k-1)))/(x-x^2). - _Robert Israel_, Jul 27 2017
%F G.f.: g(x) = (1/(1 - x))*( Sum_{n >= 1} x^(2^n-1) (1 - x^2^(n-1) ). Functional equation: g(x) = x + x*(1+x)*g(x^2). - _Wolfgang Hintze_, Aug 05 2017
%p seq(op([1$(2^n),0$(2^n)]),n=0..6); # _Robert Israel_, Jul 27 2017
%t Table[{PadRight[{},2^n,1],PadRight[{},2^n,0]},{n,0,5}]//Flatten (* _Harvey P. Dale_, May 29 2017 *)
%t Table[{Array[1&,2^n],Array[0&,2^n]},{n,0,5}]//Flatten (* _Wolfgang Hintze_, Jul 27 2017 *)
%o (PARI) a(n)=if(n<3,if(n<2,1,0),if(n%2==0,a(n/2-1),a((n-1)/2)))
%Y Cf. A005942, A079944.
%K nonn,easy
%O 1,1
%A _Ralf Stephan_, Sep 12 2003