Exercise 4. Find all pairs of non-zero natural numbers $(x, n)$ such that

$$
3 \cdot 2^{\mathrm{x}}+4=\mathrm{n}^{2}
$$
Solution to Exercise 4 For $x=0$, the equation becomes $n^{2}=7$ which has no solution. Suppose $x>0$, we factorize: $3 \cdot 2^{x}=(n-2)(n+2)$. The left-hand side is even, so the right-hand side is even. The two factors on the right-hand side are of the same parity, so they are both even, and we have two cases:

- Case 1: $3 \cdot 2^{\mathrm{a}}=\mathrm{n}-2$ and $2^{\mathrm{b}}=\mathrm{n}+2$, with $\mathrm{a}+\mathrm{b}=\mathrm{x}$. We can combine these two equations to get $2^{b}=3 \cdot 2^{a}+4$. Note that $n+2$ and $n-2$ have a difference of 4, so they cannot both be divisible by 8. Therefore, we have $a \leqslant 2$ or $b \leqslant 2$. Since $2^{b}>4$, we have $b>2$ and we deduce that $a \leqslant 2$. If $a=0,2^{b}=3+4=7$ which is not possible. If $a=1,2^{b}=6+4=10$ which is not possible either. If $a=2$, then $2^{b}=12+4=16$ so $b=4$. We get $x=6$ and $\mathrm{n}=14$. Conversely, we verify that $3 \cdot 2^{6}+4=196=14^{2}$ and the pair $(6,14)$ is indeed a solution.
- Case 2: $3 \cdot 2^{\mathrm{a}}=\mathrm{n}+2$ and $2^{\mathrm{b}}=\mathrm{n}-2$, with $\mathrm{a}+\mathrm{b}=\mathrm{x}$. The two equations combined give $\overline{2^{\mathrm{b}}+4}=3 \cdot 2^{\mathrm{a}}$. Similarly, we have $\mathrm{a} \leqslant 2$ or $\mathrm{b} \leqslant 2$.

1. If $b \leqslant 2$, then $b=0,1$ or 2. If $b=0$, then $5=3 \cdot 2^{a}$ which is not possible. If $b=1$, $6=3 \cdot 2^{\mathrm{a}}$ and $\mathrm{a}=1$, so $\mathrm{x}=2$ and $\mathrm{n}=4$ and we verify that $3 \cdot 2^{2}+4=16=4^{2}$ and $(2,4)$ is indeed a solution. If $\mathrm{b}=2$, then $8=3 \cdot 2^{\mathrm{a}}$ which is not possible.
2. If $a \leqslant 2$, then $a=0,1$ or 2. If $a=0,2^{b}+4=3<4$ which is not possible. If $a=1$, we fall back to the case where $b=1$ and the pair $(2,4)$. If $a=2,2^{b}+4=12$ so $b=3$. This gives $x=5$ and $\mathrm{n}=10$. Conversely, we verify that $3 \cdot 2^{5}+4=100=10^{2}$ and $(5,10)$ is indeed a solution.

Thus, the set of pairs $(\boldsymbol{x}, \mathfrak{n})$ that are solutions is $\{(2,4),(5,10),(6,14)\}$

Graders' Comment: The exercise is generally well solved, but many students forget some cases, or simply forget to verify the solutions found, which is crucial in a Diophantine equation.