How to Generalize the Thue-Morse Sequence to More Than Two Symbols?

combinatoricssequences-and-series

The Thue-Morse sequence is defined as a binary sequence and can be generated like

  0, 01, 01 10, 01 10 10 01, 01 10 10 01 10 01 01 10, ... . 

So the second half of the series is always the binary complement of the first half of the series.

But is there a way to generate an analogous ternary sequence?
Intuitively my first guess for a ternary Thue-Morse sequence was like

  0, 01, 012, 012 120, 012 120 120 201, 012 120 120 201 120 201 201 012, ...

So here the second half of the series is the "ternary complement" (rotation $0 \to 1, 1 \to 2, 2 \to 0 $ instead of $0 \to 1, 1 \to 0 $) of the first half.

But it could also be

  0, 01, 012, 012 120 201, 012 120 201 120 201 012 201 012 120, ... 

Here the second third is the "ternary complement" of the first third and the third third is the "ternary complement" of the second third.

Does any of my constructions for a ternary Thue-Morse series make sense?
Is there maybe a unique way to generate an analogous ternary sequence?
And how to construct n-ary versions of the Thue-Morse series in general?

Best Answer

It's $0, 012, 012 120 201, 012 120 201 120 201 012 201 012 120, ...$

To easily construct the Thue-Morse sequence, you can do the following:

Start with $0$; Replace $(0\to01)$ and $(1\to10)$. So you get: $$0, 0 1, 01 10, 0110 1001, 01101001 10010110,...$$

To easily construct the ternary version of Thue-Morse sequence, you can do the following:

Start with $0$; Replace $(0\to012), (1\to120), (2\to201).$ So you get: $$0, 0 1 2, 012 120 201, 012120201 120201012 201012120$$

To easily construct the $4$-ary version of Thue-Morse sequence, you can do the following:

Start with $0$; Replace $(0\to 0123), (1\to 1230), (2\to2301), (3\to3012).$ So you get: $$0, 0 1 2 3, 0123 1230 2301 3012, 0123123023013012 1230230130120123 2301301201231230 3012012312302301$$

To easily construct the $n$-ary version of Thue-Morse sequence, you can do the following:

Start with $0$; Replace

$$(0\to012\cdots[n-2][n-1]n), (1\to123\cdots[n-1]n0),$$

$$(2\to234\cdots n01),$$

$$\dots$$

$$(n\to n01\cdots[n-3][n-2][n-1]).$$