Alternative proof without any real numbers, logs or the like:
After relabeling we may assume n<m.
Step 1: We claim that there exists a natural number k such that m=kn.
Write the equation as
n^n n^(m-n) = m^n
n^(m-n) = (m/n)^n
The left-hand-side is always an integer. The right-hand-side is an integer if and only if such a factor k exists.
Step 2: Inserting this ansatz, we may take n-th roots and reduce the problem to n^k =k n.
Step 3: Monotonicity. Clearly we have equality for k=1.
We claim that the difference n^k-kn strictly increases with k for fixed n unless n=2, k=1. That claim in particular gives the result.
We prove this by induction in k. That is, suppose that n^k\geq kn holds for all k\leq K, then
n^(K+1) = n n^K \geq n K n \geq Kn +Kn \geq Kn +n = (K+1)n.
The second inequality is strict unless n=2 and the last one is strict unless K=1.
(m/n)^n is only an integer if m/n is an integer: true but this is quite a big piece of mathematics on its own.
The proof that no rational number squares to 2 is a famous result of number theory. That no rational non-integer, raised to any power, is any integer, surely has to be justified here.
True, but considering that the linked post uses e, log, limits and derivatives without any further comment, I am going to err on the side of "nah, enough detail".
I was interested in the proof of this ("if x is a rational number, and x raised to the power of an integer is an integer, then x is an integer"), so I asked the new Bing. It actually gave a correct proof (despite no relevant links found in Google)!
------BELOW IS BING'S OUTPUT
This statement is true. If x is a rational number and x raised to the power of an integer is an integer, then x is an integer. This statement is called the rational root theorem. The proof of this theorem is based on the fact that if x is not an integer, then it can be expressed as a fraction p/q where p and q are integers and q ≠ 0. Then, x raised to the power of an integer can be expressed as (p/q)^n which can be simplified to p^n/q^n. Since p^n and q^n are integers, p^n/q^n is a rational number. If x raised to the power of an integer is an integer, then q^n must divide p^n. Since p and q are relatively prime, this implies that q = 1. Therefore, x is an integer.
> It actually gave a correct proof (despite no relevant links found in Google)!
That is just wrong. It is the completely standard proof and can be found everywhere (the proof is over 2000 years old). Add to that, that it forgets to choose p and q as relatively prime, but then uses that at the end.... Not impressive.
Nah, k=1 is the trivial base case and is allowed. The "assumption" is no such thing, but just notational convenience. One can of course tidy that up (e.g. n\leq m and trivial case is obvious), but for a random HN post it seems not worth the effort.
Well, I guess you're right. I mean, we're looking for two disctinct numbers as the final solution, but that doesn't mean we can't use k=1 in the proof.
After relabeling we may assume n<m.
Step 1: We claim that there exists a natural number k such that m=kn.
Write the equation as
n^n n^(m-n) = m^n
n^(m-n) = (m/n)^n
The left-hand-side is always an integer. The right-hand-side is an integer if and only if such a factor k exists.
Step 2: Inserting this ansatz, we may take n-th roots and reduce the problem to n^k =k n.
Step 3: Monotonicity. Clearly we have equality for k=1. We claim that the difference n^k-kn strictly increases with k for fixed n unless n=2, k=1. That claim in particular gives the result.
We prove this by induction in k. That is, suppose that n^k\geq kn holds for all k\leq K, then
n^(K+1) = n n^K \geq n K n \geq Kn +Kn \geq Kn +n = (K+1)n.
The second inequality is strict unless n=2 and the last one is strict unless K=1.