| Here is an elementary proof: Since m and n are distinct, we may assume that m > n >= 2. From the equation and unique factorization, we know that n divides m, so write m = nd. Then (nd)^n = n^(nd).
Hence d^n = n^{n(d-1)}, which yields d = n^{d-1} >= 2^{d-1}. Claim: if k is an integer greater than or equal to 3, then k < 2^{k - 1}. Proof: the base case is clear: 3 < 4. Suppose k > 3 and k - 1 < 2^{k - 2}.
Then k < 2^{k-2} + 1 <= 2^{k-1}, where the last inequality holds because 2^{k-1} - 2^{k-2} = 2^{k-2} >= 1. QED So, d must be less than 3. Since m = nd and m and n are distinct, d is not 1, so d = 2.
Since d = n^{d-1} and d - 1 = 1, we have n = d, so m = 4. |