10.7. For natural numbers $a>b>1$, define the sequence $x_{1}, x_{2}, \ldots$ by the formula $x_{n}=\frac{a^{n}-1}{b^{n}-1}$. Find the smallest $d$ such that this sequence does not contain $d$ consecutive terms that are prime numbers, for any $a$ and $b$.

(V. Senderov)
10.7. Answer. 2.

For $a=4, b=2$ we have $\frac{a^{1}-1}{b^{1}-1}=3, \frac{a^{2}-1}{b^{2}-1}=5$. It remains to show that more than two consecutive prime numbers will not occur.

We will prove a stronger statement than required: for $n \geqslant 2$ at least one of the numbers $\frac{a^{n}-1}{b^{n}-1}, \frac{a^{n+1}-1}{b^{n+1}-1}$ is not prime. Suppose the opposite; then

\[
\begin{aligned}
& (a-1)\left(a^{n-1}+\ldots+a+1\right)=p(b-1)\left(b^{n-1}+\ldots+b+1\right) \\
& (a-1)\left(a^{n}+\ldots+a+1\right)=q(b-1)\left(b^{n}+\ldots+b+1\right)
\end{aligned}
\]

where $p$ and $q$ are prime numbers.

Suppose that $a-1$ does not divide $b-1$. Then some prime number $r$ appears in the factorization of the number $b-1$ with a power greater than in $a-1$. From (1) and (2) we get that $r$ is a common divisor of the numbers $a^{n-1}+\ldots+a+1$ and $a^{n}+\ldots+a+1$, but

\[
\begin{aligned}
& \text{GCD}\left(a^{n-1}+\ldots+a+1, a^{n}+\ldots+a+1\right)= \\
&= \text{GCD}\left(a^{n-1}+\ldots+a+1, a^{n}\right)=1
\end{aligned}
\]

Contradiction.
Thus, the number $k=\frac{a-1}{b-1}$ is an integer. From (1) we have

\[
k\left(a^{n-1}+\ldots+a+1\right)=p\left(b^{n-1}+\ldots+b+1\right)
\]

where $1<k<p$, since $b^{n-1}+\ldots+b+1<a^{n-1}+\ldots+a+1$. Therefore, $\text{GCD}(k, p)=1$, so $b^{n-1}+\ldots+b+1 \vdots k$. Similarly, from (2) it follows that $k<q$ and $b^{n}+\ldots+b+1 \vdots k$. But this contradicts the fact that $\text{GCD}\left(b^{n-1}+\ldots+b+1, b^{n}+\ldots+b+1\right)=1$.

Remark. Two consecutive prime numbers in such a sequence can be any two prime numbers of the form $p=b+1, q=b^{2}+1$. Indeed, setting $a=b^{2}$, we have $p=\frac{a-1}{b-1}, q=\frac{a^{2}-1}{b^{2}-1}$. Such pairs include, for example, $(7,37),(11,101)$ and $\left(2^{2^{3}}+1,2^{2^{4}}+1\right)$.