A079944 A run of 2^n 0's followed by a run of 2^n 1's, for n=0, 1, 2, ...
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, 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, 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
Offset: 0
References
- Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. See Example 1.34.
Links
- R. Stephan, Some divide-and-conquer sequences ...
- R. Stephan, Table of generating functions
Programs
-
Haskell
a079944 n = a079944_list !! n a079944_list = f [0,1] where f (x:xs) = x : f (xs ++ [x,x]) -- Reinhard Zumkeller, Oct 14 2010, Mar 28 2011
-
Mathematica
Table[IntegerDigits[n + 2, 2][[2]], {n, 0, 100}] (* Jean-François Alcover, Jul 26 2019 *)
-
PARI
a(n)=binary(n+2)[2] \\ Charles R Greathouse IV, Nov 07 2016
Formula
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
For n >= 2, a(n-2)=1+floor(log[2](n/3))-floor(log[2](n/2)) - Benoit Cloitre, Mar 03 2003
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
Comments