[Example 2.4.7] Find the number of all natural numbers $n$, $4 \leqslant n \leqslant 1023$, such that $n$ in binary representation does not have three consecutive identical digits.
We first do not consider the condition $4 \leqslant n \leqslant 1023$, but study any natural number $n$.

Let the number of $n$-bit numbers in binary representation that start with 1 and do not contain three consecutive identical digits be denoted as $a_{n}$.

For $a, b \in\{0,1\}$, let the notation $x_{a b}^{n}$ represent the number of $n$-bit numbers in binary representation that start with 1, end with $a b$, and do not contain three consecutive identical digits. Clearly, if the last two digits end with 00, then the last three digits can only end with 100, i.e.,
$$
x_{00}^{n}=x_{10}^{n-1},
$$

If the last two digits end with 01, then the last three digits can only end with 001 and 101, i.e.,
$$
x_{01}^{n}=x_{00}^{n-1}+x_{10}^{n-1},
$$

If the last two digits end with 10, then the last three digits can only end with 110 and 010, i.e.,
$$
x_{10}^{n}=x_{11}^{n-1}+x_{01}^{n-1},
$$

If the last two digits end with 11, then the last three digits can only end with 011, i.e.,
$$
x_{11}^{n}=x_{01}^{n-1}.
$$

Since
$$
a_{n}=x_{00}^{n}+x_{01}^{n}+x_{10}^{n}+x_{11}^{n}
$$

and similarly,
$$
\begin{array}{l} 
x_{10}^{n-1}=x_{11}^{n-2}+x_{01}^{n-2}, \\
x_{01}^{n-1}=x_{00}^{n-2}+x_{10}^{n-2}, \\
a_{n-1}= x_{00}^{n-1}+x_{01}^{n-1}+x_{10}^{n-1}+x_{11}^{n-1},
\end{array}
$$

By adding (1), (2), (3), and (4), and considering (5), (6), (7), and (8), we have
$$
\begin{aligned}
a_{n} & =x_{00}^{n}+x_{01}^{n}+x_{10}^{n}+x_{11}^{n} \\
& =x_{10}^{n-1}+x_{00}^{n-1}+x_{10}^{n-1}+x_{11}^{n-1}+x_{01}^{n-1}+x_{01}^{n-1} \\
& =a_{n-1}+x_{10}^{n-1}+x_{01}^{n-1} \\
& =a_{n-1}+x_{11}^{n-2}+x_{01}^{n-2}+x_{00}^{n-2}+x_{10}^{n-2} \\
& =a_{n-1}+a_{n-2} .
\end{aligned}
$$

Thus,
$$
a_{n}=a_{n-1}+a_{n-2} .
$$

This equation is precisely the recurrence relation of the Fibonacci sequence.
For three-bit numbers in binary, the valid ones are $101,100,110$, so $a_{3}=3$.
For four-bit numbers in binary, the valid ones are $1001,1010,1100,1101$, 1011, so $a_{4}=5$.
Since $4 \leqslant n \leqslant 1023$, in binary, these are three-digit to ten-digit numbers.
From (9) and $a_{3}=3, a_{4}=5$, we get
$$
a_{5}=8, a_{6}=13, a_{7}=21, a_{8}=34, a_{9}=55, a_{10}=89 \text {, }
$$

Thus, the number of natural numbers $n$ that satisfy the condition is
$$
a_{3}+a_{4}+\cdots+a_{10}=3+5+8+13+21+34+55+89=228 .
$$