## Task A-4.2.

Determine all pairs of integers $(m, n)$ such that $3 \cdot 2^{m}+1=n^{2}$.
## First Solution.

Notice that $m$ cannot be a negative integer because then the left side of the equation would not be an integer.

If $m=0$, then $n= \pm 2$.

Let $m>0$. If $(m, n)$ is a solution, then $(m, -n)$ is also a solution, so we will first find solutions for which $n \geqslant 0$.

The given equation can be written in the form

$$
(n-1)(n+1)=3 \cdot 2^{m}
$$

The numbers $n-1$ and $n+1$ have the same parity, so both must be even.

Moreover, since $n \geqslant 0$, both must be positive.

Therefore, we have two possibilities:

1. Case: $n-1=2^{k}, n+1=3 \cdot 2^{l}$, where $k, l \geqslant 1, k+l=m$.

We have $2=(n+1)-(n-1)=3 \cdot 2^{l}-2^{k}=2 \cdot\left(3 \cdot 2^{l-1}-2^{k-1}\right)$.

The expression in parentheses equals 1, which is odd, and this is possible only if $l=1$ or $k=1$.

(1 point)

If $l=1$, then $3-2^{k-1}=1$, so $k=2$ and further $m=3, n=5$.

(1 point)

If $k=1$, we have $3 \cdot 2^{l-1}-1=1$, which is impossible.

(1 point)

2. Case: $n-1=3 \cdot 2^{k}, n+1=2^{l}$, where $k, l \geqslant 1, k+l=m$.

Now, $2=(n+1)-(n-1)=2^{l}-3 \cdot 2^{k}=2 \cdot\left(2^{l-1}-3 \cdot 2^{k-1}\right)$.

The expression in parentheses equals 1, which is odd, and this is possible only if $l=1$ or $k=1$.

If $l=1$, then $1-3 \cdot 2^{k-1}=1$, which is impossible.

If $k=1$, then $2^{l-1}-3=1$, so $l=3$ and further $m=4, n=7$.

All solutions are $(m, n) \in\{(0,2),(0,-2),(4,7),(4,-7),(3,5),(3,-5)\}$.