5. Given a natural number $x=9^{n}-1$, where $n$ is a natural number. It is known that $x$ has exactly three distinct prime divisors, one of which is 13. Find $x$.
Answer: 728.

Solution. Since the number $x$ is even, one of its prime divisors is 2. Therefore, we need to find all $x$ that have exactly two odd prime divisors, one of which is 13. The remainders of the powers of 9 when divided by 13 are $9, 3, 1$ and then repeat cyclically. Thus, the divisibility of $x$ by 13 means that $n$ is a multiple of 3, that is, $x=9^{3m}-1$. From this,

$$
x=p \cdot q, \quad \text{where } p=9^{m}-1, \quad q=9^{2m}+9^{m}+1
$$

Note that the numbers $p$ and $q$ are coprime. Indeed, if a number $r$ divides both $p$ and $q$, then it also divides 3, since

$$
3=q-(9^{2m}-1)-(9^{m}-1)=q-p(9^{m}+2)
$$

But $p$ is not divisible by 3, hence $r=1$.

We will prove that the number $p$ is a power of two only when $m=1$. Indeed, let $m>1$. Write $p=(3^{m}-1)(3^{m}+1)$. In the right-hand side, we have the product of two consecutive even numbers, both greater than 4. Therefore, at least one of them is not divisible by 4 and, thus, is not a power of 2.

If $m=1$, we get $x=9^{3}-1=728=2^{3} \cdot 7 \cdot 13$, which fits our criteria. We will show that there are no solutions when $m>1$. One of the numbers $p$ and $q$ is divisible by 13. Consider two cases.

1) $p$ is divisible by 13. Then $m \vdots 3$, that is, $m=3k$. If $k=1$, then $p$ is divisible by 7 and 13. For $k>1$, we can apply the same reasoning to $p$ as to $x$. In both cases, $p$ will be factored into two coprime factors, neither of which is a power of 2. Therefore, $x$ has at least three different odd prime divisors, which is impossible.
2) $q$ is divisible by 13. Note that $p$ has an odd divisor, and $q$ is odd and coprime with $p$. Then $q$ must be a power of 13, that is, $q=13^{s}$ for some natural number $s$. The remainder of $q$ when divided by 8 is 5 for odd $s$ and 1 for even $s$. On the other hand, this remainder must be the same as that of $9^{2m}+9^{m}+1$, which is 3, which is impossible.