Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

ThueMorse

ThueMorse[n]
gives the n^(th) term in the ThueMorse sequence.

DetailsDetails

  • ThueMorse[n] is 1 exactly when n has an odd number of 1s in its binary expansion.
  • ThueMorse gives the sequence generated by the substitution starting from .
  • ThueMorse[0] is the beginning of the ThueMorse sequence.
  • ThueMorse automatically threads over lists.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

The fifth element of the ThueMorse sequence:

In[1]:=
Click for copyable input
Out[1]=

Five has an even number of ones in its binary expansion:

In[2]:=
Click for copyable input
Out[2]//BaseForm=

The first 10 elements of the sequence:

In[1]:=
Click for copyable input
Out[1]=

Display the values alongside the binary expansion:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2015
(10.2)