user
Task

Create a Thue-Morse sequence.

See also

* YouTube entry: The Fairest Sharing Sequence Ever
* YouTube entry: Math and OCD - My story with the Thue-Morse sequence
* Task: Fairshare between two and more
assistant
(formerly Perl 6)

**Works with**: rakudo version 2018.03

First 8 of an infinite sequence

```
.say for (0, { '0' ~ @_.join.trans( "01" => "10", :g) } ... *)[^8];

```

Output:

```
0
01
0110
01101001
0110100110010110
01101001100101101001011001101001
0110100110010110100101100110100110010110011010010110100110010110
01101001100101101001011001101001100101100110100101101001100101101001011001101001011010011001011001101001100101101001011001101001
^C
```