The Rudin–Shapiro sequence can be generated by a 4-state
automaton accepting binary representations of non-negative integers as input. The sequence is therefore 2-automatic, so by
Cobham's little theorem there exists a
2-uniform morphism \varphi with fixed point w and a coding \tau such that r = \tau(w), where r is the Rudin–Shapiro sequence. However, the Rudin–Shapiro sequence cannot be expressed as the fixed point of some uniform morphism alone. There is a recursive definition : \begin{cases} r_{2n} & = r_n \\ r_{2n+1} & = (-1)^n r_n \end{cases} The values of the terms
rn and
un in the Rudin–Shapiro sequence can be found recursively as follows. If
n =
m·2
k where
m is odd then : u_n = \begin{cases} u_{(m-1)/4} & \text{if } m \equiv 1 \pmod 4 \\ u_{(m-1)/2} + 1 & \text{if } m \equiv 3 \pmod 4 \end{cases} : r_n = \begin{cases} r_{(m-1)/4} & \text{if } m \equiv 1 \pmod 4 \\ -r_{(m-1)/2} & \text{if } m \equiv 3 \pmod 4 \end{cases} Thus
u108 =
u13 + 1 =
u3 + 1 =
u1 + 2 =
u0 + 2 = 2, which can be verified by observing that the binary representation of 108, which is 1101100, contains two sub-strings 11. And so
r108 = (−1)2 = +1. A 2-uniform morphism \varphi that requires a coding \tau to generate the Rudin-Shapiro sequence is the following:\begin{align} \varphi: a&\to ab\\ b&\to ac\\ c&\to db\\ d&\to dc \end{align} \begin{align} \tau: a&\to 1\\ b&\to 1\\ c&\to -1\\ d&\to -1 \end{align} The Rudin–Shapiro word +1 +1 +1 −1 +1 +1 −1 +1 +1 +1 +1 −1 −1 −1 +1 −1 ..., which is created by concatenating the terms of the Rudin–Shapiro sequence, is a fixed point of the morphism or
string substitution rules : +1 +1
→ +1 +1 +1 −1 : +1 −1
→ +1 +1 −1 +1 : −1 +1
→ −1 −1 +1 −1 : −1 −1
→ −1 −1 −1 +1 as follows: : +1 +1
→ +1 +1 +1 −1
→ +1 +1 +1 −1 +1 +1 −1 +1
→ +1 +1 +1 −1 +1 +1 −1 +1 +1 +1 +1 −1 −1 −1 +1 −1 ... It can be seen from the morphism rules that the Rudin–Shapiro string contains at most four consecutive +1s and at most four consecutive −1s. The sequence of partial sums of the Rudin–Shapiro sequence, defined by : s_n = \sum_{k=0}^n r_k \, , with values : 1, 2, 3, 2, 3, 4, 3, 4, 5, 6, 7, 6, 5, 4, 5, 4, ... can be shown to satisfy the inequality : \sqrt{\frac{3}{5} n} The algebraicity of S(X) over \mathbb{F}_2(X) follows from the 2-automaticity of (s_n)_{n \ge 0} by
Christol's theorem. The Rudin–Shapiro sequence along squares (r_{n^2})_{n \ge 0} is normal. The complete Rudin–Shapiro sequence satisfies the following uniform distribution result. If x \in \mathbb{R} \setminus \mathbb{Z}, then there exists \alpha = \alpha(x) \in (0,1) such that : \sum_{n which implies that (xu_n)_{n \ge 0} is uniformly distributed modulo 1 for all irrationals x. == Relationship with one-dimensional Ising model ==