Let $t$ be a positive integer such that $2^t = a^b ±1$ for some integers $a$ and $b$, each greater than $1$. What are all the possible values of $t$? Let $t$ be a positive integer such that $2^t = a^b ±1$ for some integers $a$ and $b$, each greater than $1$. What are all the possible values of $t$?
I found that $t=3$ is a solution but I don’t know how to prove that is the only solution or if there is more
Taken from the 2008 IWYMIC 
 A: As mentioned in comments, this is a special case of Catalan's conjecture, now Mihăilescu's theorem, but this special case can be solved on its own without too much suffering.
If $b$ is even, then by letting $c = a^{b/2}$, we get either $2^t = c^2 + 1$ or $2^t = c^2 - 1$. 


*

*The first case is eliminated modulo $4$: except when $t=1$ which doesn't work, $2^t \equiv 0 \pmod 4$, but $c^2 + 1$ can only be $1,2 \pmod 4$.

*In the second case, we factor $2^t = (c+1)(c-1)$, and the factors $c+1$ and $c-1$ must be powers of $2$. This is only possible when $c-1=2$ and $c+1=4$, giving us the known solution $t=3$.


If $b$ is odd, then $a^b \pm 1$ factors as two integers $a\pm 1$ and $\frac{a^b \pm 1}{a\pm 1}$, both of which must be powers of $2$. For the second factor, we have the congruence
$$
   \frac{a^b \pm 1}{a \pm 1} = 1 + (\mp a) + (\mp a)^2 + \dots + (\mp a)^{b-1} \equiv 1 + 1 + \dots + 1 = b \pmod{a \pm 1}.
$$
This congruence is a key lemma used for example in 1960 by Cassels to solve some cases of Catalan's conjecture.
There are two cases:


*

*$a\pm 1$ is odd, and a power of $2$, therefore $a\pm1 = 1$, or

*$a\pm 1$ is even, and therefore $\frac{a^b\pm1}{a\pm1} \equiv b \pmod {a\pm1}$ means that $\frac{a^b \pm 1}{a\pm 1} \equiv b \pmod 2$. So $\frac{a^b \pm 1}{a\pm 1}$ is odd, and a power of $2$, therefore $\frac{a^b \pm 1}{a\pm 1} =1$.


As a result, from $2^t = a^b \pm 1$ we arrive at either $a\pm 1 = 1$ (which would mean $a=2$, but $2^t = 2^b\pm 1$ is impossible for positive $t,b$) or $a \pm 1 = 2^t$ (which would mean $a^b = a$, contradicting that $a,b>1$). In both cases, there are no further solutions.
