<s>[INST] Determine all ordered pair (x,y) of positive integers such that $y^{2}−(x+ 2)2^x=1$. This is what I have come up so far,

*

*y has to be odd. Since $(x+2)  2^{x}$ is always even, hence $(x+2)2^x+1$ is always odd. Thus, y must be an odd number.


*$$y^2 \equiv1(mod 4)$$Since all square numbers either congruent to 0 or 1 (mod 4), but $y^2$ is odd, it has to be congruent to 1 (mod 4).
After re-writing $y=2k+1$, I am able to use quadratic formula to get k in term of x $$k=\frac{-4\pm\sqrt{16+(4)(4)(x+2)(2^x)}}{8}$$ So far, I only know that $x=5,y=15$ is a solution. I would greatly appreciate if anyone can help.
 [/INST] Rearrange first to get
$$(x+2)2^x = y^2-1.$$
Then factoring the RHS gives
$$(x+2)2^x = (y-1)(y+1).$$
Now, this implies $y-1 = a2^{m}$ and $y+1 = b2^{n}$ for some $a,b \in \mathbb{N}$ such that $ab=(x+2)$, and some $m,n \in \mathbb{N} \cup \{0\}$ such that $m+n=x$. Now, note that $2^{\min\{m,n\}}$ is a factor of both $a2^m$ and $b2^n$. And so $a2^m$ and $b2^n$ must differ by a multiple of $2^{\min\{m,n\}}$. However, as $y-1 = a2^m$ and $y+1 =b2^n$ differ by precisely 2 this implies that $2^{\min\{m,n\}}$ is either 1 or 2 and so $\min\{m,n\}$ is either 0 or 1 and so at least one of $m,n$ is 0 or 1.
Case 1: If $m \in \{0,1\}$ then on the one hand $y-1 \le a 2^m \le 2(x+2)$, and also $y+1 \ge 2^n = 2^{x-m} \ge 2^{x-1}$. But on the other hand, $y+1 = (y-1)+2$ so putting this together gives $$2^{x-1} \le y+1 = (y-1) +2 \le 2(x+2) +2,$$ which yields
$$2^{x-1} \le 2(x+2)+2.$$
There are no solutions to this for $x \ge 6$, as the LHS is larger than the RHS for all such $x$.
Case 2: If $n \in \{0,1\}$ then on the one hand $y+1 \le 2(x+2)$ and also $y-1 \ge 2^{x-1}$. But on the other hand $(y+1)=(y-1)+2$ so putting this together gives
$$2^{x-1} \le y-1 = (y+1) - 2 \le 2(x+2) -2,$$
which yields
$$2^{x-1} \le 2(x+2)-2.$$
There are no solutions to this for $x \ge 5$.
So now all that is left to do is to check whether or not there is a solution to this for $x \in \{1,2,3,4,5\}$. This can be done easily by just checking for each such $x$. [I got $x=5,y=15$ as the one solution.]
</s>