%I #29 Jul 26 2019 06:36:35
%S 0,1,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,
%T 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
%U 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1
%N A run of 2^n 0's followed by a run of 2^n 1's, for n=0, 1, 2, ...
%C With offset 2, this is the second bit in the binary expansion of n. - _Franklin T. Adams-Watters_, Feb 13 2009
%C a(n) = A173920(n+2,2); in the sequence of nonnegative integers (cf. A001477) substitute all n by 2^floor(n/2) occurrences of (n mod 2). - _Reinhard Zumkeller_, Mar 04 2010
%D Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. See Example 1.34.
%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) = floor(log[2](4*(n+2)/3)) - floor(log[2](n+2)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 22 2003
%F For n >= 2, a(n-2)=1+floor(log[2](n/3))-floor(log[2](n/2)) - _Benoit Cloitre_, Mar 03 2003
%F G.f.: 1/x^2/(1-x) * (1/x + sum(k>=0, x^(3*2^k)-x^2^(k+1))). - _Ralf Stephan_, Jun 04 2003
%F a(n) = A000035(A004526(A030101(n+2))). - _Reinhard Zumkeller_, Mar 04 2010
%t Table[IntegerDigits[n + 2, 2][[2]], {n, 0, 100}] (* _Jean-François Alcover_, Jul 26 2019 *)
%o (Haskell)
%o a079944 n = a079944_list !! n
%o a079944_list = f [0,1] where f (x:xs) = x : f (xs ++ [x,x])
%o -- _Reinhard Zumkeller_, Oct 14 2010, Mar 28 2011
%o (PARI) a(n)=binary(n+2)[2] \\ _Charles R Greathouse IV_, Nov 07 2016
%Y Cf. A086694, A079882, A079945, A173922, A173923.
%K nonn,easy
%O 0,1
%A _N. J. A. Sloane_, Feb 21 2003
|