Find all possible pairs of $(m,n)$ such that $m^2+2m-35=2^n$

elementary-number-theorynumber theory

Find all possible pairs of $(m,n)$ such that
$$m^2+2m-35=2^n$$

This question was apparantly from Stanford sheets and I want to know some innovative and generalized ways to solve this question.

Here is my approach

First note that we can factor the quadratic as $$(m+7)(m-5)=2^n$$
Now we see that $(m+7)$ and $(m-5)$ are $12$ apart. And by some guessing we note that the only powers of two that are $12$ apart are $16$ and $4$.

Therefore we set, $$m+7=16 \:\:\textrm{or} \:\:m+7=-4$$
$$m=9\:\:\textrm{or}\:\:m=-11$$
And we get, the pairs $$(9,6)\:\:\textrm{and}\:\:(-11,6)$$
This was also the official solution.

But you see that here we didn't make a generalization. So can we make it in this case$?$ Like we did some guessing thing. Also I would appreciate other approaches.

Best Answer

$$2^a - 2^b = 12 ~: ~a,b \in \Bbb{Z_{\geq 0}}, ~a > b, ~c = (a - b) \implies $$

$$(2^b)(2^c - 1) = 12.$$

$(2^c - 1)~$ must be an odd number, and $2^b$ must be an element of $\{1,2,4\}.$

Further, $2^b \in \{1,2\} \implies (2^c - 1)~$ would have to be even.

This makes it game over.