Find all $x,y\in \mathbb{N}$, such that $ x^{y}=y^{y-x} $.

I have found the solutions $(1,1)$ and $(2,4)$. I've been trying to prove that there aren't any more. I tried splitting the cases by parity, but nothing interesting seemed to come out.

I also tried rearranging it into:


Is there any way to proceed with this problem?

Thank you very much

  • 2
    $\begingroup$ Does this answer your question? Find all Pairs of Integers $(x,y)$ , $x \gt y \ge 2$ such that $x^y=y^{x-y}$ $\endgroup$ Dec 7, 2021 at 8:51
  • $\begingroup$ @Saad: That’s not the same equation though, is it (although similar methods may apply)? $\endgroup$
    – Aphelli
    Dec 7, 2021 at 9:51
  • $\begingroup$ @Mindlack Indeed, I'm not sure it can be called a duplicate, but the idea of setting $y=tx$ comes from the comment there, after which one actually reaches $y = t^{-\frac 1t}$ so the question becomes the possibly easier : for which rationals $t$ is it true that $t^{-\frac 1t}$ is an integer? $\endgroup$ Dec 7, 2021 at 10:38
  • $\begingroup$ Hint: Using Maple (still running) the first few solutions are x=1, y=1 x=2, y=4 x=9, y=27 x=64, y=256 x=625, y=3125 Interesting. All powers of the same prime. $\endgroup$
    – Wuestenfux
    Dec 7, 2021 at 10:44
  • $\begingroup$ @Teresa Lisbon: how do you get this? By the same method, I can find infinitely many solutions parametrized by $t=y/x$ (an integer). $\endgroup$
    – Aphelli
    Dec 7, 2021 at 10:45

1 Answer 1


Actually, the function can be written as $$ \left(\frac{y}{x}\right)^{y} = y^{x} $$ If you let $t = \frac{y}{x}$ then we can get $$ t^{t} = y $$ So if you apply $y = t^{t}$ and $x = t^{t - 1}$ with $t$ an integer you get infinite pairs of solutions. Furthermore, if $t$ is not an integer then $t = q/p$ which is irreducible. Then $y = (q/p)^{q/p}$ is an integer so $y^{p} = (q/p)^q$ is an integer, which is not possible. So $(x, y)$ is a solution to the equation iff $(x, y) = (t^{t-1}, t^t)$ with $t$ an integer, and there are infinitely many pairs.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .