# Solve $2^x+7=y^2$ for integer $(x,y)$

How many ordered solutions $(x,y)$ are there to the equation $2^x+7=y^2$ , where $x$ and $y$ are integers?

I tried taking cases for $x$ and $y$ like they are even or odd but I couldn't solve further.

-
– Lucian Feb 22 '14 at 17:27

Given: $2^x+7=y^2$
Since $L.H.S.$ is odd, $R.H.S$. must be odd.
Putting $y=2m+1$,
$2^x+6=4m^2+4m$,
or $2^{x-1}+3=2m^2+2m$
this forces $x=1$
putting it in original equation, we get $y=3$ and $y=-3$
Thus we have solutions $(1,3)$ and $(1,-3)$

-

HINT:

First of all, if $x<0,$ the Left Hand Side won't remain integer unlike the Right one.

Now, we have $\displaystyle 2^x+6=y^2-1=(y-1)(y+1)$

Observe that $\displaystyle y+1-(y-1)=2\implies y\pm1$ have same parity

If both are odd $2^x$ must be odd $\implies x=0$ (please test for $x=0$)

If both are even the Right Hand Side is divisible by $4$

For $x\ge2, 2^x\equiv0\pmod4\iff 2^x+6\equiv2\pmod4\implies x<2$

-
What do you mean by (mod4) ? – Henry Feb 22 '14 at 17:56
– lab bhattacharjee Feb 23 '14 at 4:08

For $x \geq 2$, the left side is $3 \pmod{4}$, while the right side can only be $0, 1 \pmod{4}$. Check by hand for the values of $x = 0, 1$.

-