This site is supported by donations to The OEIS Foundation.

 Annual Appeal: Please make a donation to keep the OEIS running. In 2018 we replaced the server with a faster one, added 20000 new sequences, and reached 7000 citations (often saying "discovered thanks to the OEIS"). Other ways to donate

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A010060 Thue-Morse sequence: let A_k denote the first 2^k terms; then A_0 = 0 and for k >= 0, A_{k+1} = A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's. 499

%I

%S 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,

%T 0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,

%U 0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1

%N Thue-Morse sequence: let A_k denote the first 2^k terms; then A_0 = 0 and for k >= 0, A_{k+1} = A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's.

%C Named after Axel Thue, whose name is pronounced as if it were spelled "Tü" where the ü sound is roughly as in the German word üben. (It is incorrect to say "Too-ee" or "Too-eh".) - _N. J. A. Sloane_, Jun 12 2018

%C Also called the Thue-Morse infinite word, or the Morse-Hedlund sequence.

%C Fixed point of the morphism 0 --> 01, 1 --> 10, see example. - _Joerg Arndt_, Mar 12 2013

%C The sequence is cubefree (does not contain three consecutive identical blocks) [see Offner for a direct proof] and is overlap-free (does not contain XYXYX where X is 0 or 1 and Y is any string of 0's and 1's).

%C a(n) = "parity sequence" = parity of number of 1's in binary representation of n.

%C To construct the sequence: alternate blocks of 0's and 1's of successive lengths A003159(k) - A003159(k-1), k = 1, 2, 3, ... (A003159(0) = 0). Example: since the first seven differences of A003159 are 1, 2, 1, 1, 2, 2, 2, the sequence starts with 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0. - _Emeric Deutsch_, Jan 10 2003

%C Characteristic function of A000069 (odious numbers). - _Ralf Stephan_, Jun 20 2003

%C a(n) = S2(n) mod 2, where S2(n) = sum of digits of n, n in base-2 notation. There is a class of generalized Thue-Morse sequences : Let Sk(n) = sum of digits of n; n in base-k notation. Let F(t) be some arithmetic function. Then a(n)= F(Sk(n)) mod m is a generalized Thue-Morse sequence. The classical Thue-Morse sequence is the case k=2, m=2, F(t)= 1*t. - _Ctibor O. Zizka_, Feb 12 2008 (with correction from _Daniel Hug_, May 19 2017)

%C More generally, the partial sums of the generalized Thue-Morse sequences a(n) = F(Sk(n)) mod m are fractal, where Sk(n) is sum of digits of n, n in base k; F(t) is an arithmetic function; m integer. - _Ctibor O. Zizka_, Feb 25 2008

%C Starting with offset 1, = running sums mod 2 of the kneading sequence (A035263, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1,...); also parity of A005187: (1, 3, 4, 7, 8, 10, 11, 15, 16, 18, 19,...). - _Gary W. Adamson_, Jun 15 2008

%C Generalized Thue-Morse sequences mod n (n>1) = the array shown in A141803. As n -> Inf. the sequences -> (1, 2, 3,...). - _Gary W. Adamson_, Jul 10 2008

%C The Thue-Morse sequence for N = 3 = A053838, (sum of digits of n in base 3, mod 3): (0, 1, 2, 1, 2, 0, 2, 0, 1, 1, 2,...) = A004128 mod 3. - _Gary W. Adamson_, Aug 24 2008

%C For all positive integers k, the subsequence a(0) to a(2^k-1) is identical to the subsequence a(2^k+2^(k-1)) to a(2^(k+1)+2^(k-1)-1). That is to say, the first half of A_k is identical to the second half of B_k, and the second half of A_k is identical to the first quarter of B_{k+1}, which consists of the k/2 terms immediately following B_k.

%C Proof: The subsequence a(2^k+2^(k-1)) to a(2^(k+1)-1), the second half of B_k, is by definition formed from the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, by interchanging its 0s and 1s. In turn, the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, which is by definition also B_{k-1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), the first half of A_k, which is by definition also A_{k-1}, by interchanging its 0s and 1s. Interchanging the 0s and 1s of a subsequence twice leaves it unchanged, so the subsequence a(2^k+2^(k-1)) to a(2^(k+1)-1), the second half of B_k, must be identical to the subsequence a(0) to a(2^(k-1)-1), the first half of A_k.

%C Also, the subsequence a(2^(k+1)) to a(2^(k+1)+2^(k-1)-1), the first quarter of B_{k+1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), the first quarter of A_{k+1}, by interchanging its 0s and 1s. As noted above, the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, which is by definition also B_{k-1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), which is by definition A_{k-1}, by interchanging its 0s and 1s, as well. If two subsequences are formed from the same subsequence by interchanging its 0s and 1s then they must be identical, so the subsequence a(2^(k+1)) to a(2^(k+1)+2^(k-1)-1), the first quarter of B_{k+1}, must be identical to the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k.

%C Therefore the subsequence a(0), ..., a(2^(k-1)-1), a(2^(k-1)),..., a(2^k-1) is identical to the subsequence a(2^k+2^(k-1)), ..., a(2^(k+1)-1), a(2^(k+1)), ..., a(2^(k+1)+2^(k-1)-1), QED.

%C According to the German chess rules of 1929 a game of chess was drawn if the same sequence of moves was repeated three times consecutively. Euwe, see the references, proved that this rule could lead to infinite games. For his proof he reinvented the Thue-Morse sequence. - _Johannes W. Meijer_, Feb 04 2010

%C "Thue-Morse 0->01 & 1->10, at each stage append the previous with its complement. Start with 0, 1, 2, 3 and write them in binary. Next calculate the sum of the digits (mod 2) - that is divide the sum by 2 and use the remainder." Pickover, The Math Book.

%C Let s_2(n) be the sum of the base-2 digits of n and epsilon(n) = (-1)^s_2(n), the Thue-Morse sequence, then prod(n >= 0, ((2*n+1)/(2*n+2))^epsilon(n) ) = 1/sqrt(2). - _Jonathan Vos Post_, Jun 06 2012

%C Dekking shows that the constant obtained by interpreting this sequence as a binary expansion is transcendental; see also "The Ubiquitous Prouhet-Thue-Morse Sequence". - _Charles R Greathouse IV_, Jul 23 2013

%C Drmota, Mauduit, and Rivat proved that the subsequence a(n^2) is normal--see A228039. - _Jonathan Sondow_, Sep 03 2013

%C Although the probability of a 0 or 1 is equal, guesses predicated on the latest bit seen produce a correct match 2 out of 3 times. - _Bill McEachen_, Mar 13 2015

%D Max A. Alekseyev, Donovan Johnson and N. J. A. Sloane, On Kaprekar's Junction Numbers, in preparation, 2017.

%D J.-P. Allouche and M. Mendes France, Automata and Automatic Sequences, in: Axel F. and Gratias D. (eds), Beyond Quasicrystals. Centre de Physique des Houches, vol 3. Springer, Berlin, Heidelberg, pp. 293-367, 1995; DOI https://doi.org/10.1007/978-3-662-03130-8_11.

%D J.-P. Allouche and J. Shallit, The ring of k-regular sequences, II, Theoret. Computer Sci., 307 (2003), 3-29.

%D J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 15.

%D J.-P. Allouche and H. Cohen, "Dirichlet Series and Curious Infinite Products." Bull. London Math. Soc. 17, 531-538, 1985.

%D F. Axel et al., Vibrational modes in a one dimensional "quasi-alloy": the Morse case, J. de Physique, Colloq. C3, Supp. to No. 7, Vol. 47 (Jul 1986), pp. C3-181-C3-186; see Eq. (10).

%D Jason Bell, Michael Coons, and Eric Rowland, "The Rational-Transcendental Dichotomy of Mahler Functions", Journal of Integer Sequences, Vol. 16 (2013), #13.2.10.

%D J. Berstel and J. Karhumaki, Combinatorics on words - a tutorial, Bull. EATCS, #79 (2003), pp. 178-228.

%D B. Bollobas, The Art of Mathematics: Coffee Time in Memphis, Cambridge, 2006, p. 224.

%D S. Brlek, Enumeration of factors in the Thue-Morse word, Discrete Applied Math., 24 (1989), 83-96. doi:10.1016/0166-218X(92)90274-E.

%D Yann Bugeaud and Guo-Niu Han,, A combinatorial proof of the non-vanishing of Hankel determinants of the Thue-Morse sequence, Electronic Journal of Combinatorics 21(3) (2014), #P3.26.

%D Y. Bugeaud and M. Queffélec, On Rational Approximation of the Binary Thue-Morse-Mahler Number, Journal of Integer Sequences, 16 (2013), #13.2.3.

%D J. Cooper and A. Dutle, Greedy Galois Games, Amer. Math. Mnthly, 120 (2013), 441-451.

%D Currie, James D. "Non-repetitive words: Ages and essences." Combinatorica 16.1 (1996): 19-40

%D A. de Luca and S. Varricchio, Some combinatorial properties of the Thue-Morse sequence and a problem in semigroups, Theoret. Comput. Sci. 63 (1989), 333-348.

%D Colin Defant, Anti-Power Prefixes of the Thue-Morse Word Journal of Combinatorics, 24(1) (2017), #P1.32

%D F. Dejean, Sur un theoreme de Thue. J. Combinatorial Theory Ser. A 13 (1972), 90-99.

%D F. M. Dekking, Transcendence du nombre de Thue-Morse, Comptes Rendus de l'Academie des Sciences de Paris 285 (1977), pp. 157-160.

%D F. M. Dekking, On repetitions of blocks in binary sequences. J. Combinatorial Theory Ser. A 20 (1976), no. 3, pp. 292-299. MR0429728(55 #2739)

%D Arthur Dolgopolov. Equitable Sequencing and Allocation Under Uncertainty, Preprint, 2016; https://arthurdolgopolov.net/papers/TM.pdf

%D Dubickas, Artūras. On a sequence related to that of Thue-Morse and its applications. Discrete Math. 307 (2007), no. 9-10, 1082--1093. MR2292537 (2008b:11086).

%D Fabien Durand, Julien Leroy, and Gwenaël Richomme, "Do the Properties of an S-adic Representation Determine Factor Complexity?", Journal of Integer Sequences, Vol. 16 (2013), #13.2.6.

%D M. Euwe, Mengentheoretische Betrachtungen Über das Schachspiel, Proceedings Koninklijke Nederlandse Akademie van Wetenschappen, Amsterdam, Vol. 32 (5): 633-642, 1929.

%D S. Ferenczi, Complexity of sequences and dynamical systems, Discrete Math., 206 (1999), 145-154.

%D S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 6.8.

%D W. H. Gottschalk and G. A. Hedlund, Topological Dynamics. American Mathematical Society, Colloquium Publications, Vol. 36, Providence, RI, 1955, p. 105.

%D J. Grytczuk, Thue type problems for graphs, points and numbers, Discrete Math., 308 (2008), 4419-4429.

%D G. A. Hedlund, Remarks on the work of Axel Thue on sequences, Nordisk Mat. Tid., 15 (1967), 148-150.

%D A. Hof, O. Knill and B. Simon, Singular continuous spectrum for palindromic Schroedinger operators, Commun. Math. Phys. 174 (1995), 149-159.

%D Mari Huova and Juhani Karhumäki, "On Unavoidability of k-abelian Squares in Pure Morphic Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.9.

%D B. Kitchens, Review of "Computational Ergodic Theory" by G. H. Choe, Bull. Amer. Math. Soc., 44 (2007), 147-155.

%D Le Breton, Xavier, Linear independence of automatic formal power series. Discrete Math. 306 (2006), no. 15, 1776-1780.

%D M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 23.

%D Donald MacMurray, A mathematician gives an hour to chess, Chess Review 6 (No. 10, 1938), 238. [Discusses Marston's 1938 article]

%D Mauduit, Christian. Multiplicative properties of the Thue-Morse sequence. Period. Math. Hungar. 43 (2001), no. 1-2, 137--153. MR1830572 (2002i:11081)

%D Mignosi, F.; Restivo, A.; Sciortino, M. Words and forbidden factors. WORDS (Rouen, 1999). Theoret. Comput. Sci. 273 (2002), no. 1-2, 99--117. MR1872445 (2002m:68096)

%D Marston Morse, Title?, Bull. Amer. Math. Soc., 44 (No. 9, 1938), p. 632. [Mentions an application to chess]

%D C. A. Pickover, Wonders of Numbers, Adventures in Mathematics, Mind and Meaning, Chapter 17, 'The Pipes of Papua,' Oxford University Press, Oxford, England, 2000, pages 34-38.

%D C. A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.

%D Clifford A. Pickover, The Math Book, From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, Sterling Publ., NY, 2009, page 316.

%D E. Prouhet, Memoire sur quelques relations entre les puissances des nombres, Comptes Rendus Acad. des Sciences, 33 (No. 8, 1851), p. 225 [Said to implicitly mention this sequence]

%D Narad Rampersad and Elise Vaslet, "On Highly Repetitive and Power Free Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.7.

%D G. Richomme, K. Saari, L. Q. Zamboni, Abelian complexity in minimal subshifts, J. London Math. Soc. 83(1) (2011) 79-95.

%D Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

%D M. Rigo, P. Salimov, and E. Vandomme, "Some Properties of Abelian Return Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.5.

%D Benoit Rittaud, Elise Janvresse, Emmanuel Lesigne and Jean-Christophe Novelli, Quand les maths se font discrètes, Le Pommier, 2008 (ISBN 978-2-7465-0370-0).

%D A. Salomaa, Jewels of Formal Language Theory. Computer Science Press, Rockville, MD, 1981, p. 6.

%D Shallit, J. O. "On Infinite Products Associated with Sums of Digits." J. Number Th. 21, 128-134, 1985.

%D Ian Stewart, "Feedback", Mathematical Recreations Column, Scientific American, 274 (No. 3, 1996), page 109 [Historical notes on this sequence]

%D Thomas Stoll, On digital blocks of polynomial values and extractions in the Rudin-Shapiro sequence, RAIRO - Theoretical Informatics and Applications (RAIRO: ITA), EDP Sciences, 2016, 50, pp. 93-99. <hal-01278708>.

%D A. Thue. Über unendliche Zeichenreihen, Norske Vid. Selsk. Skr. I. Mat. Nat. Kl. Christiania, No. 7 (1906), 1-22.

%D A. Thue, Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen, Norske Vid. Selsk. Skr. I. Mat. Nat. Kl. Christiania, 1 (1912), 1-67.

%D S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 890.

%H N. J. A. Sloane, <a href="/A010060/b010060.txt">Table of n, a(n) for n = 0..16383</a>

%H A. G. M. Ahmed, <a href="http://archive.bridgesmathart.org/2013/bridges2013-263.pdf">AA Weaving</a>. In: Proceedings of Bridges 2013: Mathematics, Music, Art, ..., 2013.

%H A. Aksenov, <a href="http://arxiv.org/abs/1108.5352">The Newman phenomenon and Lucas sequence</a>, arXiv preprint arXiv:1108.5352 [math.NT], 2011-2012.

%H J.-P. Allouche, <a href="http://algo.inria.fr/seminars/sem92-93/allouche.ps">Series and infinite products related to binary expansions of integers</a>, Behaviour, 4.4 (1992): p. 5.

%H J.-P. Allouche, <a href="http://ssdnm.mimuw.edu.pl/pliki/wyklady/allouche-uj.pdf">Lecture notes on automatic sequences</a>, Krakow October 2013.

%H J.-P. Allouche, <a href="http://dx.doi.org/10.5802/jtnb.906">Thue, Combinatorics on words, and conjectures inspired by the Thue-Morse sequence</a>, J. de Théorie des Nombres de Bordeaux, 27, no. 2 (2015), 375-388.

%H J.-P. Allouche, Andre Arnold, Jean Berstel, Srecko Brlek, William Jockusch, Simon Plouffe and Bruce E. Sagan, <a href="http://dx.doi.org/10.1016/0012-365X(93)00147-W">A relative of the Thue-Morse sequence</a>, Discrete Math., 139 (1995), 455-461.

%H Jean-Paul Allouche, Julien Cassaigne, Jeffrey Shallit, Luca Q. Zamboni, <a href="https://arxiv.org/abs/1711.10807">A Taxonomy of Morphic Sequences</a>, arXiv preprint arXiv:1711.10807 [cs.FL], Nov 29 2017.

%H J.-P. Allouche and Jeffrey Shallit, <a href="http://www.cs.uwaterloo.ca/~shallit/Papers/ubiq.ps">The Ubiquitous Prouhet-Thue-Morse Sequence</a>, in C. Ding. T. Helleseth and H. Niederreiter, eds., Sequences and Their Applications: Proceedings of SETA '98, Springer-Verlag, 1999, pp. 1-16.

%H J.-P. Allouche and J. Shallit, <a href="http://www.math.jussieu.fr/~allouche/kreg2.ps">The Ring of k-regular Sequences, II</a>, Theoretical Computer Science 307.1 (2003): 3-29.

%H Joerg Arndt, <a href="http://www.jjj.de/fxt/#fxtbook">Matters Computational (The Fxtbook)</a>, p. 44.

%H G. N. Arzhantseva, C. H. Cashen, D. Gruber, D. Hume, <a href="http://arxiv.org/abs/1602.03767">Contracting geodesics in infinitely presented graphical small cancellation groups</a>, arXiv preprint arXiv:1602.03767 [math.GR], 2016-2018.

%H Ricardo Astudillo, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL6/Astudillo/astudillo12.html">On a Class of Thue-Morse Type Sequences</a>, J. Integer Seqs., Vol. 6, 2003.

%H M. Baake, U. Grimm, J. Nilsson, <a href="http://arxiv.org/abs/1311.4371">Scaling of the Thue-Morse diffraction measure</a>, arXiv preprint arXiv:1311.4371 [math-ph], 2013.

%H Scott Balchin and Dan Rust, <a href="http://www.emis.ams.org/journals/JIS/VOL20/Rust/rust3.html">Computations for Symbolic Substitutions</a>, Journal of Integer Sequences, Vol. 20 (2017), Article 17.4.1.

%H Lucilla Baldini, Josef Eschgfäller, <a href="http://arxiv.org/abs/1609.01750">Random functions from coupled dynamical systems</a>, arXiv preprint arXiv:1609.01750 [math.CO], 2016. See Example 3.11.

%H J. Berstel, <a href="/A010060/a010060.pdf">Axel Thue's papers on repetitions in words: a translation</a>, July 21 1994. Publications du LaCIM, Département de mathématiques et d'informatique 20, Université du Québec à Montréal, 1995, 85 pages. [Cached copy]

%H J.-F. Bertazzon, <a href="http://arxiv.org/abs/1201.2502">Resolution of an integral equation with the Thue-Morse sequence</a>, arXiv:1201.2502v1 [math.CO], Jan 12, 2012.

%H F. Michel Dekking, <a href="http://arxiv.org/abs/1509.00260"> Morphisms, Symbolic sequences, and their Standard Forms</a>, arXiv:1509.00260 [math.CO], 2015.

%H E. Deutsch and B. E. Sagan, <a href="http://arxiv.org/abs/math.CO/0407326">Congruences for Catalan and Motzkin numbers and related sequences</a>, J. Num. Theory 117 (2006), 191-215.

%H M. Drmota, C. Mauduit, J. Rivat, <a href="http://www.dmg.tuwien.ac.at/drmota/alongsquares.pdf">The Thue-Morse Sequence Along The Squares is Normal</a>, Abstract, ÖMG-DMV Congress, 2013.

%H J. Endrullis, D. Hendriks and J. W. Klop, <a href="https://www.researchgate.net/profile/Joerg_Endrullis/publication/235711311_Degrees_of_Streams/links/00b495321615fe0696000000.pdf">Degrees of streams</a>, Journal of Integers B 11 (2011): 1-40..

%H A. S. Fraenkel, <a href="http://www.emis.de/journals/INTEGERS/papers/eg6/eg6.Abstract.html">New games related to old and new sequences</a>, INTEGERS, Electronic J. of Combinatorial Number Theory, Vol. 4, Paper G6, 2004.

%H Hao Fu, GN Han, <a href="http://arxiv.org/abs/1601.04370">Computer assisted proof for Apwenian sequences related to Hankel determinants</a>, arXiv preprint arXiv:1601.04370 [math.NT], 2016.

%H Maciej Gawro and Maciej Ulas, "On formal inverse of the Prouhet-Thue-Morse sequence." Discrete Mathematics 339.5 (2016): 1459-1470. Also <a href="http://arxiv.org/abs/1601.04840">arXiv:1601.04840</a>, 2016.

%H Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a>

%H Daniel Goc, Luke Schaeffer and Jeffrey Shallit, <a href="http://arxiv.org/abs/1206.5352">The Subword Complexity of k-Automatic Sequences is k-Synchronized</a>, arXiv 1206.5352 [cs.FL], Jun 28 2012.

%H Dimitri Hendriks, Frits G. W. Dannenberg, Jorg Endrullis, Mark Dow and Jan Willem Klop, <a href="http://arxiv.org/abs/1201.3786">Arithmetic Self-Similarity of Infinite Sequences</a>, arXiv preprint 1201.3786 [math.CO], 2012.

%H A. M. Hinz, S. Klavžar, U. Milutinović, C. Petr, <a href="http://dx.doi.org/10.1007/978-3-0348-0237-6">The Tower of Hanoi - Myths and Maths</a>, Birkhäuser 2013. See page 79. <a href="http://tohbook.info">Website for book</a>

%H Tanya Khovanova, <a href="http://arxiv.org/abs/1405.6958">There are no coincidences</a>, arXiv preprint 1410.2193 [math.CO], 2014.

%H Naoki Kobayashi, Kazutaka Matsuda and Ayumi Shinohara, <a href="http://www.kb.ecei.tohoku.ac.jp/~koba/papers/pepm2012-full.pdf">Functional Programs as Compressed Data</a>, Higher-Order and Symbolic Computation, 25, no. 1 (2012): 39-84..

%H Philip Lafrance, Narad Rampersad, Randy Yee, <a href="http://arxiv.org/abs/1408.2277">Some properties of a Rudin-Shapiro-like sequence</a>, arXiv:1408.2277 [math.CO], 2014.

%H C. Mauduit, J. Rivat, <a href="http://dx.doi.org/10.1007/s11511-009-0040-0">La somme des chiffres des carres</a>, Acta Mathem. 203 (1) (2009) 107-148.

%H M. Morse, <a href="http://dx.doi.org/10.1090/S0002-9947-1921-1501161-8">Recurrent geodesics on a surface of negative curvature</a>, Trans. Amer. Math. Soc., 22 (1921), 84-100.

%H K. Nakano, <a href="http://dx.doi.org/10.1007/978-3-642-35308-6_14">Shall We Juggle, Coinductively?</a>, in Certified Programs and Proofs, Lecture Notes in Computer Science Volume 7679, 2012, pp. 160-172.

%H Nguyen, Hieu D., <a href="http://arxiv.org/abs/1405.6958">A mixing of Prouhet-Thue-Morse sequences and Rademacher functions</a>, arXiv preprint arXiv:1405.6958 [math.NT], 2014.

%H Hieu D. Nguyen, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Nguyen/nguyen6.html">A Generalization of the Digital Binomial Theorem </a>, J. Int. Seq. 18 (2015) # 15.5.7.

%H C. D. Offner, <a href="http://www.rw.cdl.uni-saarland.de/~joba/Info3/material/quadratfrei.pdf">Repetitions of Words and the Thue-Morse sequence</a>. Preprint, no date.

%H Matt Parker, <a href="https://www.youtube.com/watch?v=prh72BLNjIk">The Fairest Sharing Sequence Ever</a>, YouTube video, Nov 27 2015

%H A. Parreau, M. Rigo, E. Rowland, E. Vandomme, <a href="http://arxiv.org/abs/1405.3532">A new approach to the 2-regularity of the l-abelian complexity of 2-automatic sequences</a>, arXiv preprint arXiv:1405.3532 [cs.FL], 2014.

%H C. A. Pickover, "Wonders of Numbers, Adventures in Mathematics, Mind and Meaning," <a href="http://www.zentralblatt-math.org/zmath/en/search/?q=an:0983.00008&amp;format=complete">Zentralblatt review</a>

%H Michel Rigo, <a href="http://arxiv.org/abs/1602.03364">Relations on words</a>, arXiv preprint arXiv:1602.03364 [cs.FL], 2016.

%H Luke Schaeffer, Jeffrey Shallit, <a href="http://www.combinatorics.org/ojs/index.php/eljc/article/view/v23i1p25">Closed, Palindromic, Rich, Privileged, Trapezoidal, and Balanced Words in Automatic Sequences</a>, Electronic Journal of Combinatorics 23(1) (2016), #P1.25.

%H M. R. Schroeder & N. J. A. Sloane, <a href="/A005599/a005599.pdf">Correspondence, 1991</a>

%H R. Schroeppel and R. W. Gosper, <a href="http://www.inwap.com/pdp10/hbaker/hakmem/series.html#item122">HACKMEM #122</a> (1972).

%H V. Shevelev, <a href="http://arxiv.org/abs/1603.04434">Two analogs of Thue-Morse sequence</a>, arXiv preprint arXiv:1603.04434 [math.NT], 2016-2017.

%H N. J. A. Sloane, <a href="/A010060/a010060.txt">The first 1000 terms as a string</a>

%H L. Spiegelhofer, <a href="http://dx.doi.org/10.1093/qmath/hav029">Normality of the Thue-Morse Sequence along Piatetski-Shapiro sequences</a>, Quart. J. Math. 66 (3) (2015)

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Thue-MorseSequence.html">Thue-Morse Sequence</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Thue-MorseConstant.html">Thue-Morse Constant</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Parity.html">Parity</a>

%H Joost Winter, Marcello M. Bonsangue, and Jan J. M. M. Rutten, <a href="http://oai.cwi.nl/oai/asset/21313/21313A.pdf">Context-free coalgebras</a>, Journal of Computer and System Sciences, 81.5 (2015): 911-939.

%H <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>

%H <a href="/index/Cor#core">Index entries for "core" sequences</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(2n) = a(n), a(2n+1) = 1 - a(n), a(0) = 0. Also, a(k+2^m) = 1 - a(k) if 0 <= k < 2^m.

%F If n = Sum b_i*2^i is the binary expansion of n then a(n) = Sum b_i (mod 2).

%F Let S(0) = 0 and for k >= 1, construct S(k) from S(k-1) by mapping 0 -> 01 and 1 -> 10; sequence is S(infinity).

%F G.f.: (1/(1 - x) - Product_{k >= 0} (1 - x^(2^k)))/2. - _Benoit Cloitre_, Apr 23 2003

%F a(0) = 0, a(n) = (n + a(floor(n/2))) mod 2; also a(0) = 0, a(n) = (n - a(floor(n/2))) mod 2. - _Benoit Cloitre_, Dec 10 2003

%F a(n) = -1 + (sum_{k=0..n} binomial(n,k) mod 2) mod 3 = -1 + A001316(n) mod 3. - _Benoit Cloitre_, May 09 2004

%F Let b(1) = 1 and b(n) = b(ceiling(n/2)) - b(floor(n/2)) then a(n-1) = (1/2)*(1 - b(2n-1)). - _Benoit Cloitre_, Apr 26 2005

%F a(n) = 1 - A010059(n) = A001285(n) - 1. - _Ralf Stephan_, Jun 20 2003

%F a(n) = A001969(n) - 2n. - _Franklin T. Adams-Watters_, Aug 28 2006

%F a(n) = A115384(n) - A115384(n-1) for n > 0. - _Reinhard Zumkeller_, Aug 26 2007

%F For n >= 0, a(A004760(n+1)) = 1 - a(n). - _Vladimir Shevelev_, Apr 25 2009

%F a(A160217(n)) = 1 - a(n). - _Vladimir Shevelev_, May 05 2009

%F a(n) == A000069(n) (mod 2). - _Robert G. Wilson v_, Jan 18 2012

%F a(n) = A000035(A000120(n)). - _Omar E. Pol_, Oct 26 2013

%F a(n) = A000035(A193231(n)). - _Antti Karttunen_, Dec 27 2013

%F a(n) + A181155(n-1) = 2n for n >= 1. - _Clark Kimberling_, Oct 06 2014

%e The evolution starting at 0 is:

%e .0

%e .0, 1

%e .0, 1, 1, 0

%e .0, 1, 1, 0, 1, 0, 0, 1

%e .0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0

%e .0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1

%e .......

%e A_2 = 0 1 1 0, so B_2 = 1 0 0 1 and A_3 = A_2 B_2 = 0 1 1 0 1 0 0 1.

%e From _Joerg Arndt_, Mar 12 2013: (Start)

%e The first steps of the iterated substitution are

%e Start: 0

%e Rules:

%e 0 --> 01

%e 1 --> 10

%e -------------

%e 0: (#=1)

%e 0

%e 1: (#=2)

%e 01

%e 2: (#=4)

%e 0110

%e 3: (#=8)

%e 01101001

%e 4: (#=16)

%e 0110100110010110

%e 5: (#=32)

%e 01101001100101101001011001101001

%e 6: (#=64)

%e 0110100110010110100101100110100110010110011010010110100110010110

%e (End)

%e From _Omar E. Pol_, Oct 28 2013: (Start)

%e Written as an irregular triangle in which row lengths is A011782, the sequence begins:

%e 0;

%e 1;

%e 1,0;

%e 1,0,0,1;

%e 1,0,0,1,0,1,1,0;

%e 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1;

%e 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0;

%e It appears that: row j lists the first A011782(j) terms of A010059, with j >= 0; row sums give A166444 which is also 0 together with A011782; right border gives A000035.

%e (End)

%p s := proc(k) local i, ans; ans := [ 0,1 ]; for i from 0 to k do ans := [ op(ans),op(map(n->(n+1) mod 2, ans)) ] od; return ans; end; t1 := s(6); A010060 := n->t1[n]; # s(k) gives first 2^(k+2) terms.

%p a := proc(k) b := [0]: for n from 1 to k do b := subs({0=[0,1], 1=[1,0]},b) od: b; end; # a(k), after the removal of the brackets, gives the first 2^k terms. # Example: a(3); gives [[[[0, 1], [1, 0]], [[1, 0], [0, 1]]]]

%p A010060:=proc(n)

%p add(i,i=convert(n, base, 2)) mod 2 ;

%p end proc:

%p seq(A010060(n),n=0..104); # _Emeric Deutsch_, Mar 19 2005

%p map(`-`,convert(StringTools[ThueMorse](1000),bytes),48); # _Robert Israel_, Sep 22 2014

%t Table[ If[ OddQ[ Count[ IntegerDigits[n, 2], 1]], 1, 0], {n, 0, 100}];

%t mt = 0; Do[ mt = ToString[mt] <> ToString[(10^(2^n) - 1)/9 - ToExpression[mt] ], {n, 0, 6} ]; Prepend[ RealDigits[ N[ ToExpression[mt], 2^7] ] [ [1] ], 0]

%t Mod[ Count[ #, 1 ]& /@Table[ IntegerDigits[ i, 2 ], {i, 0, 2^7 - 1} ], 2 ] (* _Harlan J. Brothers_, Feb 05 2005 *)

%t Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 7] (* _Robert G. Wilson v_ Sep 26 2006 *)

%t a[n_] := If[n == 0, 0, If[Mod[n, 2] == 0, a[n/2], 1 - a[(n - 1)/2]]] (* _Ben Branman_, Oct 22 2010 *)

%t a[n_] := Mod[Length[FixedPointList[BitAnd[#, # - 1] &, n]], 2] (* _Jan Mangaldan_, Jul 23 2015 *)

%t Table[2/3 (1 - Cos[Pi/3 (n - Sum[(-1)^Binomial[n, k], {k, 1, n}])]), {n, 0, 100}] (* or, for version 10.2 or higher *) Table[ThueMorse[n], {n, 0, 100}] (* _Vladimir Reshetnikov_, May 06 2016 *)

%t ThueMorse[Range[0, 100]] (* The program uses the ThueMorse function from Mathematica version 11 *) (* _Harvey P. Dale_, Aug 11 2016 *)

%o a010060 n = a010060_list !! n

%o a010060_list =

%o 0 : interleave (complement a010060_list) (tail a010060_list)

%o where complement = map (1 - )

%o interleave (x:xs) ys = x : interleave ys xs

%o -- Doug McIlroy (doug(AT)cs.dartmouth.edu), Jun 29 2003

%o -- Edited by _Reinhard Zumkeller_, Oct 03 2012

%o (PARI) a(n)=if(n<1,0,sum(k=0,length(binary(n))-1,bittest(n,k))%2)

%o (PARI) a(n)=if(n<1,0,subst(Pol(binary(n)), x,1)%2)

%o (PARI) default(realprecision, 6100); x=0.0; m=20080; for (n=1, m-1, x=x+x; x=x+sum(k=0, length(binary(n))-1, bittest(n, k))%2); x=2*x/2^m; for (n=0, 20000, d=floor(x); x=(x-d)*2; write("b010060.txt", n, " ", d)); \\ _Harry J. Smith_, Apr 28 2009

%o (PARI) a(n)=hammingweight(n)%2 \\ _Charles R Greathouse IV_, Mar 22 2013

%o (Python)

%o A010060_list = [0]

%o for _ in range(14):

%o A010060_list += [1-d for d in A010060_list] # _Chai Wah Wu_, Mar 04 2016

%o (R)

%o maxrow <- 8 # by choice

%o b01 <- 1

%o for(m in 0:maxrow) for(k in 0:(2^m-1)){

%o b01[2^(m+1)+ k] <- b01[2^m+k]

%o b01[2^(m+1)+2^m+k] <- 1-b01[2^m+k]

%o }

%o (b01 <- c(0,b01))

%o # _Yosu Yurramendi_, Apr 10 2017

%Y Cf. A001285 (for 1, 2 version), A010059 (for 1, 0 version), A106400 (for +1, -1 version), A048707. A010060(n)=A000120(n) mod 2.

%Y Cf. A007413, A080813, A080814, A036581, A108694. See also the Thue (or Roth) constant A014578, also A014571.

%Y Cf. also A001969, A035263, A005187, A115384, A132680, A141803, A104248, A193231.

%Y Run lengths give A026465. Backward first differences give A029883.

%Y Cf. A004128, A053838, A059448, A171900, A161916, A214212, A005942 (subword complexity), A010693 (Abelian complexity), A225186 (squares), A228039 (a(n^2)), A282317.

%Y Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.

%K nonn,core,easy,nice

%O 0,1

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified December 13 04:16 EST 2018. Contains 318081 sequences. (Running on oeis4.)