Question on partial answer of the generalized Catalan’s conjecture (case $n =2$)

elementary-number-theory

Edited question.

Let $n,m\in\Bbb N$ be integers greater or equal to $2$. If $3\leq m<n$ then there is no $m,n$ such that $m^n -n^m =2$. If $n<m$ and $m$ is prime then there is no $m,n$ such that $m^n-n^m =2$. If $m = 2$ then there is no $n$ such that $m^n- n^m = 2$.

Original question.

Let $n\geq 2$ be an integer and $p$ be a prime number. Then there is no $p,n$ such that $p^n – n^p =2$.

False Proof : Consider the case when $p$ is odd prime. Then
by FLT, $n^{p-1}\equiv 1\bmod p$ so $n^p = p^n-2 \equiv n\bmod p$. $\color{#C00}{\text{Then $n^{p+1} = (p+1)^n -2\equiv n\bmod p+1$ so $n^p\equiv 1\bmod p+1$}}$. $p^n – 2 = (p+1)m+1$ for some $m$ so that $p^n =(p+1)m+3 = pm+m+3$. Hence, $p(p^{n-1}-m) = m+3 = pk_0$ for some integer $k_0$ so that $m = pk_0-3$. Then $p(p^{n-1}-pk_0+3) = pk_0$ so $p^{n-1}-pk_0= k_0-3$. Since, $p(p^{n-2}-k_0) = k_0-3$ and letting $k_0 = pk_1+3$, we get $p(p^{n-2}-pk_1-3) = pk_1$ i.e. $p^{n-2}-pk_1 = k_1+3$. Hence inductively, we conclude that $p(1-k_N) = k_N\pm 3$ for some large $N$. This gives the contradiction.

Rough idea given by @robjohn ♦: We want to show that $p^n-n^p=2$ is impossible, so if $n=kp-2$, consider $p^{kp-2}-(kp-2)^p$
Dividing both sides by $(kp)^p$, we have $\frac{p^{(k-1)p}}{k^pp^2}-\left(1-\frac2{kp}\right)^p$.

If $k=1$, this is $\frac1{p^2}-\left(1-\frac2{p}\right)^p$ which is less than $0$. If $k\ge2$, then $\left(\frac{p^{k-1}}{kp^{2/p}}\right)^p-\left(1-\frac2{kp}\right)^p$ is greater than $0$ and multiplied by $(kp)^p$ is much bigger than $2$.

Best Answer

If $p$ is prime, then looking at $p^n-n^p=2$ mod $p$ shows that $n\equiv-2\pmod{p}$.

We don't need to consider $p=2$, since then $n$ must be even and then $p^n$ and $n^p$ are divisible by $4$.


$\boldsymbol{n\lt p}$

Since $n\equiv-2\pmod{p}$, if $n\lt p$, we must have that $n=p-2$ $$ \begin{align} p^n-n^p &=p^{p-2}-(p-2)^p\tag{1a}\\ &=p^p\left(\frac1{p^2}-\left(1-\frac2p\right)^p\right)\tag{1b} \end{align} $$ Explanation:
$\text{(1a)}$: $n=p-2$
$\text{(1b)}$: factor $p^p$ out front

For $p=3$, $\text{(1a)}$ gives $3^1-1^3=2$ (which is the only solution).

$\left(1-\frac2p\right)^p$ is an increasing function: $$ \begin{align} \frac{\left(1-\frac2{p+1}\right)^{p+1}}{\left(1-\frac2p\right)^p} &=\frac{p-2}p\left(\frac{p-1}{p+1}\frac{p}{p-2}\right)^{p+1}\tag{2a}\\ &=\frac{p-2}p\left(1+\frac2{(p+1)(p-2)}\right)^{p+1}\tag{2b}\\[3pt] &\ge\frac{p-2}p\left(1+\frac2{p-2}\right)\tag{2c}\\[9pt] &=1\tag{2d} \end{align} $$ Explanation:
$\text{(2a)}$: $1-\frac2{p+1}=\frac{p-1}{p+1}$ and $1-\frac2p=\frac{p-2}p$
$\text{(2b)}$: $\frac{p-1}{p+1}\frac{p}{p-2}=1+\frac2{(p+1)(p-2)}$
$\text{(2c)}$: Bernoulli's Inequality
$\text{(2d)}$: simplify

Since $\frac1{p^2}$ is a decreasing function, for $p\ge4$, we have that $\frac1{p^2}-\left(1-\frac2p\right)^p\le0$, which implies $p^n-n^p\le0$

Thus, for $n\lt p$, the only solution is $3^1-1^3=2$.


$\boldsymbol{n\gt p}$

Since $n\gt p\ge3$, for $k\ge1$, $$ \begin{align} p^{p+k}-(p+k)^p &\ge p^p\left(p^k-e^k\right)\tag{3a}\\[1pt] &\ge p^p(p-e)ke^{k-1}\tag{3b}\\[3pt] &\ge 27(3-e)\tag{3c}\\[3pt] &\gt7\tag{3d} \end{align} $$ Explanation:
$\text{(3a)}$: $\left(1+\frac kp\right)^{p/k}\le e$
$\text{(3b)}$: $p^k-e^k=(p-e)\sum\limits_{j=0}^{k-1}p^{k-j-1}e^j\ge(p-e)ke^{k-1}$
$\text{(3c)}$: $p\ge3$ and $k\ge1$
$\text{(3d)}$: $27(3-e)\approx7.60639$

Therefore, $p^n-n^p\gt7$, and so no solution exists.

Related Question