17. (CZE) ${ }^{\mathrm{DMO} 05}$ Find all pairs of integers $x, y \geq 1$ satisfying the equation $x^{y^{2}}=y^{x}$.
17. We note first that $x$ and $y$ must be powers of the same positive integer. Indeed, if $x=p_{1}^{\alpha_{1}} \cdots p_{k}^{\alpha_{k}}$ and $y=p_{1}^{1_{1}} \cdots p_{k}^{\beta_{k}}$ (some of $\alpha_{i}$ and $\beta_{i}$ may be 0 , but not both for the same index $i$ ), then $x^{y^{2}}=y^{x}$ implies $\frac{a_{1}}{\beta_{4}}=\frac{x}{y^{2}}=\frac{P}{q}$ for some $p, q>0$ with $\operatorname{god}(p, q)=1$, so for $a=p_{1}^{\alpha_{1} / p} \cdots p_{k}^{\alpha_{d} / p}$ we can take $x=a^{p}$ and $y=a^{q}$.
If $a=1$, then $(x, y)=(1,1)$ is the trivial solution. Let $a>1$. The given equation becomes $a^{p a^{2 q}}=a^{p a^{p}}$, which reduces to $p a^{2 q}=q a^{p}$. Hence $p \neq q$. so we distinguish two cases:
(i) $p>q$. Then from $a^{2 q}2 q$. We can rewrite the equation as $p=a^{p-2 q} q$, and putting $p=2 q+d, d>0$, we obtain $d=q\left(\alpha^{d}-2\right)$. By induction, $2^{d}-2>d$ for each $d>2$, so we must have $d \leq 2$. For $d=1$ we get $q=1$ and $a=p=3$, and therefore $(x, y)=(27,3)$, which is indeed a solution. For $d=2$ we get $q=1$, $a=2$, and $p=4$, so $(x, y)=(16,2)$, which is another solution.
(ii) $p0$, this is transformed to $a^{d}=a^{\left(2 a^{d}-1\right) \mathrm{P}}$, or equivalently to $d=\left(2 a^{d}-1\right) p$. However, this equality cannot hold, because $2 a^{d}-1>d$ for each $a \geq 2$, $d \geq 1$.
The only solutions are thus $(1,1),(16,2)$, and $(27,3)$.