# $n^2-2^m = 1$, cant find the answer [closed]

Hello today my teacher told us to find the solutions for $$n^2-2^m = 1$$ I came up with n= square root of 33 and m = 5, but after a review i saw that my calcultions were wrong ( i think ). could someone explain me if it was just a case or i did something right in my calculations ? thanks in advance.

• Partial Differential Equations?
– lulu
Oct 23, 2023 at 13:47
• You calculated a correct pairing, but my guess is that $n,m$ are expected to be integers. I would start with a smaller $n$ to begin with... Oct 23, 2023 at 13:48
• There's an obvious solution in integers, presumably this is what you were meant to look for. There are infinitely many solutions if you don't require them to be integers.
– lulu
Oct 23, 2023 at 13:48
• Does this answer your question? Find all answers of $n^2-2^m=1$ - found using an Approach0 search. As lulu's comment indicates, this is assuming that $m$ and $n$ are integers since, otherwise, there are infinitely many solutions. Oct 23, 2023 at 19:32
• A nice little fact to carry around is Mihailescu's theorem, which states that the only two perfect powers (greater than $1$) that differ by $1$ are $8,9$ Oct 23, 2023 at 21:03

You can rewrite that as $$2^m = n^2 -1$$ which is the same as $$2^m = (n+1)\times(n-1)$$
It immediately yields that both $$n+1$$ and $$n-1$$ are exact powers of 2. We can say that $$\dfrac{n+1}{n-1}$$ must be $$2$$: it cannot be 1 (would lead to $$2 = 0$$!), and any value strictly greater than 2 (4, 8, ...) would imply $$n < 0$$.
So the solution is given by: $$\dfrac{n+1}{n-1}=2 \Leftrightarrow n+1 = 2n -2 \Leftrightarrow n=3$$
We can deduce immediately that $$2^m = 3^2 -1 = 8$$, so $$m=3$$.