When is $2^n \pm 1$ a perfect power

Is there an easy way of showing that $2^n \pm 1$ is never a perfect power, except for $2^3 + 1 = 3^2 $?

I know that Catalan's conjecture (or Mihăilescu's theorem) gives the result directly, but I'm hopefully for a more elementary method.


I can show that it is never a square, except for $2^3 + 1$.

Proof: Cases $n=1, 2, 3$ are easily dealt with. Henceforth, let $n\geq4$.

$2^n -1 \equiv 3 \pmod{4}$ hence is never a square.

If $2^n +1 =x^2$, then $2^n = (x-1)(x+1)$ and both of these are powers of 2. Thus we must have $(x-1) = 2, (x+1) = 4$. This gives the solution of $2^3 + 1 = 3^2$.


Let's now do an odd prime.

Say $2^n +1 = x^p$. Then $2^n = x^p - 1 = (x-1)(x^{p-1}+x^{p-2} + \ldots +1)$, so both terms are powers of 2. We have $ x = 2^m+1$ is odd. But the other term is the sum of $p$ odd numbers, hence is odd. Since this is clearly greater than 1, we get a contradiction.

Say $2^n -1 = x^p$. Then $2^n = x^p + 1 = (x+1)(x^{p-1} - x^{p-2} + \ldots -x +1 )$, so both terms are powers of 2. We have $x = 2^m -1$ is odd. But the other term is the sum of $p$ odd numbers, hence is odd. Since $x^p + 1 \neq x+1$ except for $p=1$, this means that the term is greater than 1. Hence we get a contradiction.


(This proof was completed with an insightful comment from Gottfried. I'm placing it as an answer so that it is readily seen that an answer exists, as opposed to just leaving it in the question.)

Suppose we have $ 2^n \pm 1 = x^k$ for some positive integers $x, k$. Cases $n=1, 2, 3$ are easily dealt with. $n=3$ yields the solution $2^3 + 1 = 3^2$. Henceforth, let $n\geq4$. Furthermore, a simple check shows that $x\neq 1, 2$.

First, we will deal with the power $k=2l$ being even. Rewriting $x^{2l}$ as $(x^l)^2$, we may assume that $k=2$.

Proof: $2^n -1 \equiv 3 \pmod{4}$ hence is never a square.

If $2^n +1 =x^2$, then $2^n = (x-1)(x+1)$ and both of these are powers of 2 that differ by 2. Thus we must have $(x-1) = 2, (x+1) = 4$, which gives $2^n = 8$ so $n=3$ (reject). $_\square$

Now, we deal with $k$ odd.

Proof: Say $2^n +1 = x^k$. Then $2^n = x^k - 1 = (x-1)(x^{k-1}+x^{k-2} + \ldots +1)$, so both terms are powers of 2. We have $ x -1$ is a power of 2 greater than 1, hence is even. Thus $x$ is odd. But the other term is the sum of $k$ odd numbers, hence is odd. Since this is clearly greater than 1, we get a contradiction.

Say $2^n -1 = x^k$. Then $2^n = x^k + 1 = (x+1)(x^{k-1} - x^{k-2} + \ldots -x +1 )$, so both terms are powers of 2. We have $x+1$ is a power of 2 that is greater than 1, hence is even. Thus $x$ is odd. But the other term is the sum of $p$ odd numbers, hence is odd. Since $x^p + 1 \neq x+1$ except for $p=1$, this means that the term is greater than 1. Hence we get a contradiction. $ _\square$


We can still generalize your result by elementary means a bit more:

Theorem 1: The only non-trivial solution to $p^k+1=x^n$ for $p\in\mathbb{P},k,x,n \in \mathbb{N}$ are $p,k,x,n=2,3,3,2$.

Proof: We only need to care about $n$ prime. If $n=2$, we would have. $$p^k=(x-1)(x+1)$$ Since both parentheses must be powers of $p$, and since the only powers that are $2$ units apart are $2$ and $4$, we obtain $p=2,k=3,x=3$.

So let's deal now with the odd case: $$p^k=(x-1)(x^{n-1}+x^{n-2}+\cdots+1)$$

Both parentheses must be powers of $p$. If $x=2$, we have already dealt with that case. Else $x$ must be of the form $p^e+1$, but then the first parenthesis would be $p^e$ and the second one would be way greater than $p^e$ and would need to be a power of $p$. That implies that they have $p^e$ as a common factor. But by the residue theorem, $(x-1,x^{n-1}+x^{n-2}+\cdots1)=n$, which is prime. So $e=1$, and $p=n$. So now we have in the second parenthesis: $$(p+1)^{p-1}+(p+1)^{p-2}+\cdots+1=\cdots+\frac{(p-1)p}{2}p+p=p(\cdots+\frac{(p-1)p}{2}+1)$$

Since $2|p-1$, the value inside the parenthesis $\equiv 1 \pmod p$. But that is impossible.

Theorem 2: If there are no solutions to $p^k-1=x^2$, the only non-trivial solution to $p^k-1=x^n$ for $p\in\mathbb{P},k,x,n \in \mathbb{N}$ are $p,k,x,n=3,2,2,3$.

Proof: It is practically the same as the one for the theorem $1$, with the only difference being some signs. But at the end we still arrive at the condratiction of having the second parentheses $\equiv p \pmod {p^2}$, and greater than $p$. If there is any doubt, I can provide details.


Remarks: I attempted to remove the innecesary condition for theorem $2$ but I couldn't, I would be glad to hear suggestions or proofs for doing so. Also, I would like to mention that both theorems work for any prime power $p$. Finally we may note that the Theorem 1 one is just at a composite case of distance to become Mihailescu's theorem. But may the force be with you if you try to do it.


I collected everything you may need about elementary methods solving special cases of Mihailescu theorem here (see cases (iii) and (vii) for this problem)