Solve $n^m+m^n=n!+m!$

157 Views Asked by At

Determine all $(n,m) \in \Bbb N^2$ such that $n^m+m^n=n!+m!$
Clearly $(1,1), (1,2), (2,1)$ are solutions and they seem to be the only ones (At least they're the only solutions if $n\le 1000$ and $m\le 1000$ ) I've been thinking for quite sometime and I can't come up with any ideas.

1

There are 1 best solutions below

0
On BEST ANSWER

Wlog. $n\ge m$. If $n=m$, the equation sayas $n^n=n!$, which is only possible with $n=1$ ($n$ factors $=n$ on the left, $n$ factors $\le n$ on the right).

So assume $n>m$. The case $m=1$ leads to $n+1=n!+1$, so only $n=1$, $n=2$ are possible,

So assume $n>m>1$ and pick a prime $p$ with $p\mid m$. For an integer $k$, let $v_p(k)$ denote the exponent with which $p$ divides $k$, that is $p^{v(k)}\mid k$ and $p^{v(k)+1}\nmid k$. Let $v_p(0)=\infty$ be understood. It is well-known that $$\tag1 v_p(a\pm b)=\min\{v_p(a),v_p(b)\}\qquad \text{if }v_p(a)\ne v_p(b).$$ Also, the formula for the factorial is well-known, namely $$\tag2v_p(m!)= \left\lfloor \frac mp\right\rfloor + \left\lfloor \frac m{p^2}\right\rfloor + \left\lfloor \frac m{p^3}\right\rfloor+\ldots$$ Note that certainly $$ \tag3v_p(m!)<\frac m2+\frac m4+\frac m8+\ldots =m.$$ Likewise, $$\tag4v_p(n!)= \left\lfloor \frac np\right\rfloor + \left\lfloor \frac n{p^2}\right\rfloor + \left\lfloor \frac n{p^3}\right\rfloor+\ldots$$ From $p\mid m!+n!-m^n=n^m$, we conclude $p\mid n$, hence $n\ge m+p$ and therefore $$\tag5v_p(n!)>v_p(m!).$$ Next, $$\tag6v_p(m^n)=nv_p(m)\ge n>v_p(m!)$$ so that using $(1)$ (once with $(5)$ and once with $(6)$), we get $$ m\le mv_p(n)=v_p(n^m)=v_p(n!+m!-m^n)=v_p(m!)<m,$$ contradiction.