Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$2^4=16=4^2$. In fact, $\{2,4\}$ is the only pair of natural numbers with that property, i.e. if $m<n$ are natural numbers and $m^n=n^m$, then $m=2$ and $n=4$.

This is easily seen with some analysis: For $m,n\in\mathbf{N}\backslash\{0\}$, the equation $m^n=n^m$ is equivalent to $\sqrt[m]{m}=\sqrt[n]{n}$. By calculus, we can show that the real function $t\mapsto \sqrt[t]{t}$ is strictly increasing for $t<e$ and strictly decreasing for $t>e$. So the smaller of the two numbers has to be $<e$ and the proposition follows.

My question: Is there an elementary proof? By elementary I mean most of all no irrational numbers, no calculus.

share|cite|improve this question
If only I had my time machine (or a better memory) I could give you an answer. I once gave a presentation related to this (as well as whether $e^{\pi}$ was greater than $\pi^e$), but the details escape me right now. I remember an analytical approach like what you described, and I can't remember what else I did :( – Michael McGowan Jun 27 '11 at 20:58
use unique factorization – yoyo Jun 27 '11 at 21:00
I think this is a duplicate, but I can't find the previous one... – Arturo Magidin Jun 27 '11 at 21:03
@Arturo: Did you mean this:…? – Aryabhata Jun 27 '11 at 21:04
@Aryabhata: Hmmm... yes, but I somehow have the impression of having seen the problem solved by considering the prime factorization (e.g., for every prime $p$ we must have $n\mathrm{ord}_p(m) = m\mathrm{ord}_p(n)$), and that question doesn't do that... – Arturo Magidin Jun 27 '11 at 21:08
up vote 23 down vote accepted

The relation $m^n=n^m$ implies that $n,m$ have the same prime factors $p_1<p_2<...<p_k$. Suppose $m=\prod p_i^{\alpha_i},\ n=\prod p_i^{\beta_i}$. By the unique factorization theorem and the relation $m^n=n^m$ we get that $\alpha_i n=\beta_i m$. Suppose $m>n$. This implies $\alpha_i>\beta_i$ since $\alpha_i/\beta_i=m/n$. Therefore $n|m$.

Denote $m=dn$ and $(dn)^n=n^{(dn)}$ i.e. $dn=n^d$ or $d=n^{d-1}$. For $n \geq 2$ we have $n^{d-1}\geq d$ with equality for $d=1$ (which is not good since $m>n$) or $d=2,n=2$ and therefore $m=4$.

share|cite|improve this answer

HINT $\ $ wlog $\rm\displaystyle\ m > n\ \Rightarrow\ \bigg(\frac{m}n\bigg)^n =\: n^{m-n}\in \mathbb Z\ \Rightarrow\ k := \frac{m}n \in\mathbb Z\ \Rightarrow\ k = n^{k-1}\ \Rightarrow\:\cdots$

NOTE $\ $ Above I have implicitly invoked the Rational Root Test to infer that for $\rm\:j\in \mathbb Z,\: n\in \mathbb N\:,\:$ rational roots of $\rm\ x^n -j\ $ must be integers. $\:$ Above is the special case $\rm\ x = m/n,\ j = n^{m-n}\:.$

share|cite|improve this answer
Thanks for the hint. The second $\Rightarrow$ needs unique factorization, right? – Stefan Jun 28 '11 at 21:32
@Stefan Unique factorization is a bit overkill. It suffices to apply the Rational Root Test to $\rm\:x^n - j\:,\:$ to infer that any rational root is integral - just as in irrationality proofs. Said more technically, it uses only that $\mathbb Z$ is integrally closed (as is any UFD). – Bill Dubuque Jun 28 '11 at 22:24

Have a look here (in particular from "Try this: Substitute").

share|cite|improve this answer

There is a rather pretty picture: given any real numbers $a,b > 1,$ the relation $$ a^b = b^a $$ is equivalent to $$ \frac{\log a}{a} = \frac{\log b}{b}.$$ So what you do is draw the graph $$ y = \log x $$ and then draw any line through the origin with positive slope (but smaller than $1/e$). The line intersects the curve in two points, with $x$-values $a,b$ satisfying $ a^b = b^a.$ The smaller of the two numbers $a,b$ lies between $1$ and $e,$ so the only possible integer is $2.$ In that case, the other $x$-value is $4.$

share|cite|improve this answer
It is the (nearly) same method suggested by the OP at the second paragraph. – user10676 Jun 28 '11 at 11:15
It does look that way. – Will Jagy Jun 28 '11 at 18:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.