Find all solutions of $a^b = b^a$ [duplicate]

Find all solutions to $$a^b = b^a$$ where $a, b$ are natural numbers with $a<b$.

So far I've been able to conclude that this is equivalent to $$\frac{log(a)}{a} = \frac{log(b)}{b}$$ but I'm not sure how to proceed. Can someone please give me a hint?


Solution 1:

The only solution with $a,b\in\mathbb{N}$ and $a<b$ is $a=2,b=4$:

  • $a=1,b>a \implies a^b<b^a$

  • $a=2,b=3 \implies a^b<b^a$

  • $a=2,b=4 \implies a^b=b^a$

  • $a=2,b>4 \implies a^b>b^a$

  • $a>2,b>a \implies a^b>b^a$

Solution 2:

As I establish in another answer, all real solutions to this equation can be written in the form $$ a = t^{1/(t-1)}, \quad b = t^{t/(t-1)} = t\cdot a $$ Where $t$ is an arbitrary real number not equal to $0$ or $1$. The question is then reduced to: for what $t$ are both $a(t)$ and $b(t)$ natural numbers?

Note that if $t$ is irrational, either $a$ or $b$ must be irrational.

So, write $t = p/q$ for arbitrary integers $p$ and $q$ with $p \neq q$ and $p,q\neq 0$. We then have $$ a = (p/q)^{1/(p/q - 1)} = (p/q)^{q/(p-q)}, \quad b = (p/q)^{p/(p-q)} $$ Now, note that the rational power of a rational number can only be an integer if we started with an integer. So, without loss of generality, we can assume $q = 1$. So, we have $$ a = p^{1/(p-1)}, \quad b = p^{p/(p-1)} $$ So, the question is now as follows: for what integers $p$ (not equal to $0$ or $1$) is $p^{1/(p-1)} = \sqrt[p-1]{p}$ an integer? It turns out that the only answer is $p=2$.

So, the only pair of natural numbers that works here is $$ a = 2, \quad b = 4 $$