5. Find all prime numbers whose decimal representation has the form 101010 ... 101 (ones and zeros alternate).
Solution: Let $2n+1$ be the number of digits in the number $A=101010$...101 under investigation. Let $q=$ 10 be the base of the numeral system. Then $A=q^{0}+q^{2}+\cdots q^{2n}=\frac{q^{2n+2}-1}{q^{2}-1}$. Consider the cases of even and odd $n$.

- $n=2k \Rightarrow A=\frac{q^{2n+2}-1}{q^{2}-1}=\frac{q^{2k+1}-1}{q-1} \cdot \frac{q^{2k+1}+1}{q+1}$. Thus, the number $A$ is represented as the product of two integer factors (by the theorem of Bezout, the polynomial $q^{2k+1} \pm 1$ is divisible without remainder by the polynomial $q \pm 1$), each of which is different from 1. Therefore, when $n$ is even, the number $A$ is not prime.
- $n=2k-1 \Rightarrow A=\frac{q^{2n+2}-1}{q^{2}-1}=\frac{q^{2k}-1}{q^{2}-1} \cdot (q^{2k}+1)$. For $k>1$, both factors are integers and different from 1; thus, the number $A$ is composite. It remains to verify that for $k=1$, the resulting number $A=q^{0}+q^{2}=101$ is prime.

Answer: 101.