generate a Thue-Morse string
ThueMorse( n, a, b )
non-negative integer; specifies that ThueMorse must return then nth Thue-Morse string
character; (optional) first symbol to use
character; (optional) second symbol to use
The ThueMorse(n, a, b) command generates the length-n prefix of the (infinite) Thue-Morse string, with initial values a and b. The arguments after the first are optional, and default to the strings 0 and 1, respectively.
The Thue-Morse string is the infinite string defined to be the fixed point of the iterated semigroup morphism 0−>01,1−>10 on the free semigroup generated by 0,1.
A recursive definition of the Thue-Morse sequence is as follows. t0=0, t2⁢n=tn, t1+2⁢n=1−tn.
All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
Download Help Document
What kind of issue would you like to report? (Optional)