# How many integer pairs $(n,m)$ do exist such that $m^p-p^n=1$ where $p$ is prime?

Let $p$ be prime. How many integer pairs $(n,m)$ exist such that $$m^p-p^n=1?$$

When $p=2$, I have shown that the only integer pair that satisfies our condition is $(3,2)$ and when $p=3$ I have shown there are no integer pairs that satisfy our condition.

I suspect that there are no integer pairs for any prime $p>2$, but my attempts at generalizing have failed. I have observed that we can rearrange our condition a bit: $$m^p-p^n=1 \iff p^n = m^p-1 = (m-1)(m^{p-1}+m^{p-2}+\cdots+m+1),$$ Which implies that $m-1=p^k$ for some $1\le k <n$ and that $$p^n=\left(p^k+1\right)^p-1.$$ Not sure what to do next. I have manipulated and massaged this relationship, but I do not see how to get anything useful from what I have. Any ideas or references about this?

• This is Catalan's conjecture, now Mihăilescu's theorem as it has been proved that $(3,2)$ is the only solution – Ross Millikan Oct 21 '17 at 4:26
• @RossMillikan As $p$ occurs twice, this is only a special case of Mihailescu's theorem. I don't know whether it has a simpler proof... – Lord Shark the Unknown Oct 21 '17 at 4:42
• Thanks for the references! I suspect the special case presented here has a simpler proof as it appeared as a contest problem. – Laars Helenius Oct 21 '17 at 4:55

As you've written, setting $m=p^k+1$ where $k$ is a non-negative integer gives, by the binomial theorem, $$p^n=(p^k+1)^p-1=\binom p1p^k+\binom p2p^{2k}+\binom p3p^{3k}+\cdots +\binom{p}{p-1}p^{(p-1)k}+\binom ppp^{pk}$$ Dividing the both sides by $p^{k+1}$ gives $$p^{n-k-1}=1+\binom p2p^{k-1}+\binom p3p^{2k-1}+\cdots +p^{(p-2)k}+p^{pk-k-1}$$ Here, if $k-1\ge 1$, then the LHS is divisible by $p$ while the RHS isn't.
So, we have to have $k-1\lt 1$, i.e. $k=0,1$.
• Case 1 : $k=0$$p^n=2^p-1\implies 2^p\equiv 1\pmod p$$Since$p$has to be an odd prime with$\gcd(p,2)=1$, by Fermat's little theorem, we have$2^{p-1}\equiv 1\pmod p\implies 2^p\equiv 2\pmod p$. There are no odd primes satisfying both$2^p\equiv 1\pmod p$and$2^p\equiv 2\pmod p$. • Case 2 :$k=1$$p^{n-2}=1+\frac{p(p-1)}{2}+\binom p3p+\cdots +p^{p-2}+p^{p-2}$$Here, if $p$ is an odd prime, then the LHS is divisible by $p$ while the RHS isn't. So, we have to have $p=2$ to have $$2^{n}=(2+1)^2-1=2^3\implies n=3$$
It follows from the two cases that $\color{red}{(n,m,p)=(3,3,2)}$ is the only solution.