# Find all answers of $n^2-2^m=1$

Find all natural numbers $(n,m)$ where $n^{2}-2^{m}=1$.
I have my own answer of that, however I wanted to know if anyone has a better or easier answer or not!

-

We have $n^{2}-1=(n-1)(n+1)=2^m$, So let $k=n-1$. Then we know that $k$ and $k+2$ should both be $2^m$'s divisors and also we know that all of divisors of $2^{m}$ are in a geometric progression with the common ratio $2$. Thus, $k+2=2^{i}k$.We take $i=1$ (See the proof at the end), and so $k=2$ and $n=3$. By putting $n=3$ in the equation we may get $m=3$. So the only answers would be $(3,3)$.
Now we must prove that if $k+2=2^{i}k$, Then $i=1$. Suppose $i>1$. Then $2=k(2^{i}-1)$ and so $k=\frac{2}{2^{i}-1}$ which is impossible since $k$ is a natural number and $2<2^{i}-1$ for $i>1$.

-
Technically, that's $k+2=2^i k$, with $i \ge 0$. But the remaining cases are trivial. – Lord_Farin May 7 '13 at 13:30
Thanks. I added the case at the end. – CODE May 7 '13 at 14:08

Obviously, $n \equiv 1 \mod 2$ (since $m>0$). Therefore, there exists $k$ s.t. $2k + 1 = n$.
Now, $4k^2 + 4k + 1 - 2^m = 1$ and $k(k+1) = 2^{m-2}$. Clearly $m \neq 1, 2$. When $m \ge 3$, since one and only one of $k$ and $k+1$ can be even, one of two is $2^{m-2}$ and other is $1$. Clearly, it is possible only when $k = 1$ ($n = 3$) and $m = 3$.