Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
See Ramanujan-Nagell equation. – Lucian Feb 22 '14 at 17:27
up vote 7 down vote accepted

Given: $2^x+7=y^2$
Since $L.H.S.$ is odd, $R.H.S$. must be odd.
Putting $y=2m+1$,
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)$

share|cite|improve this answer


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$

share|cite|improve this answer
What do you mean by (mod4) ? – Henry Feb 22 '14 at 17:56
@Samurai, – 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$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.