2. In the set of natural numbers, solve the equation

$$
x^{5-x}=(6-x)^{1-x}
$$
Solution. It is easily verified that for $x=0$, which is not possible. Therefore, $x$ must be an odd number. Let $x=2k+1, k \geq 3$. Then the given equation is successively equivalent to the equations

\[
\begin{aligned}
& (2k+1)^{4-2k} = (5-2k)^{-2k} \\
& (2k+1)^{2k-4} = (5-2k)^{2k} \\
& (2k+1)^{2k-4} = (5-2k)^{2k-4}(5-2k)^4 \\
& \left(\frac{2k+1}{5-2k}\right)^{2k-4} = (2k-5)^4 \\
& \left(1+\frac{6}{2k-5}\right)^{2k-4} = (2k-5)^4
\end{aligned}
\]

According to this, $2k-5 \in \{\pm 1, \pm 2, \pm 3, \pm 6\}$. However, $2k-5$ is an odd number, so $2k-5 \in \{\pm 1, \pm 3\}$. If $2k-5 \in \{-1, -3\}$, then $2k+1 < 7$. If $2k-5 \in \{1, 3\}$, then $2k+1 \in \{7, 9\}$. By direct verification, we find that in this case only $x=2k+1=9$ is a solution to the original equation.

Finally, the solutions to the given equation are: $x=1, x=5$, and $x=9$.