Originally Posted by

**ThePerfectHacker** This problem was developed by me, however I have been able to find it somewhere on the internet that says Euler solved it. Though I do not believe in that because it is way too simple for Euler, he would not concern himself with something like that. In addition, I discussed this with a professor and he said he liked to give this problem in his number theory class.

Unlike most diophantine equations this one solves nicely and easily. The reason why I am not in the favor of TD!'s method is because he is introducing the real numbers into this problem, while it only deals with positive integers, though I am sure you can make it work. The standard classical way to appraoch diophantine equation is to work with divisibility between these expressions, which is the approach that will be used here.

---

Let us assume that $\displaystyle a,b$ are postive integers such as,

$\displaystyle a^b=b^a$.

By trichtonomy $\displaystyle a>b,a<b,a=b$.

Let us first work with $\displaystyle a>b$.

Let, $\displaystyle \gcd(a,b)=d$, then we can write,

$\displaystyle a=a'd$ and $\displaystyle b=b'd$ where $\displaystyle \gcd(a',b')=1$.

Thus, the diophantine equation becomes,

$\displaystyle (a'd)^b=(b'd)^a$.

Thus, we have,

$\displaystyle (a')^bd^b=(b')^ad^a$

Thus, (note that $\displaystyle a>b$ :eek: )

$\displaystyle (a')^b=(b')^ad^{a-b}$

Note, the right hand side is divisible by $\displaystyle b'$ thus the left hand side is divisible by $\displaystyle b'$.

But, $\displaystyle \gcd(a',b')=1$ thus, $\displaystyle b'=1$.

This condition can only happen when,

$\displaystyle \gcd(a,b)=b$.

That means $\displaystyle b|a$ if and only if $\displaystyle a=bk$ for some $\displaystyle k>1$.

Substituting this into our diophantine equation,

$\displaystyle (bk)^b=b^{bk}$

Thus,

$\displaystyle (bk)^b=(b^k)^b$

If, $\displaystyle b=1$ then $\displaystyle a^b\not = b^a$.

Thus, $\displaystyle b\not = 1$ thus,

$\displaystyle bk=b^k$

Dividing both sides by $\displaystyle b$,

$\displaystyle k=b^{k-1}$

~~~

It should seem clear the right hand side is larger then the left hand side because it is an exponential, but we need to determine when this inequality occurs.

~~~

If $\displaystyle b=2$ (since $\displaystyle b>1$) then,

$\displaystyle k=2^{k-1}$

Since $\displaystyle k>1$ we go through the values of $\displaystyle k$ and see what happens,

$\displaystyle 2=2^1$

$\displaystyle 3<2^2$

$\displaystyle 3<2^4$

.....

We show by induction that the right hand side is larger for $\displaystyle k>2$,

$\displaystyle k<2^{k-1}$

$\displaystyle k+1<2k<2^k$

Thus, we have equality only for $\displaystyle k=2,b=2$ in that case, $\displaystyle a=bk=(2)(2)=4$.

Now we turn to when $\displaystyle b=3$ we have for the first few values,

$\displaystyle 2<3^1$

$\displaystyle 3<3^2$

$\displaystyle 4<3^3$

We show this is true by induction,

$\displaystyle k>2$

$\displaystyle k<3^{k-1}$

$\displaystyle k+1<3k<3^k$

Now it is reasonable to say for larger bases $\displaystyle b$ we can no way get equality. Thus, for $\displaystyle b\geq 3$ and $\displaystyle k>1$ we have,

$\displaystyle k<b^{k-1}$

$\displaystyle k+1<bk<b^k$--->Proved.

These inequalities show that $\displaystyle a=4,b=2$ is the only possible solution. We need to check and we see that,

$\displaystyle 4^2=2^4$.

---

When, $\displaystyle a<b$ without loss of generality we have $\displaystyle a=2,b=4$.

---

When, $\displaystyle a=b$ we have the trivial solutions.