ThueMorse

ThueMorse[n]

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

Details

  • 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.

Examples

open allclose all

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]=

Scope  (2)

Applications  (1)

Properties & Relations  (8)

Neat Examples  (1)

See Also

RudinShapiro  DigitCount  SubstitutionSystem  FindSequenceFunction

Introduced in 2015
(10.2)