<s>[INST] $3\times 2^m + 4 = n^2$ I have been trying to solve this problem but I couldn't find any way to find the answers. Find all natural numbers m and n such that:
$3\times\ 2^m + 4 = n^2$
This is a question from the Moroccan Maths Olympiad (2019.)
I tried bringing $4$ to the other side and factorising to get: $3\times 2^m=(n+2)(n−2),$ and I tried solving for that $n+2$ is a multiple of three then $n-2$ is a multiple of three but I couldn't find anything.
Can anyone help me please?
 [/INST] $$3\cdot2^{m} + 4 = n^2$$
We take the three cases $m=3a, m=3a+1,$ and $m=3a+2.$
The problem can be reduced to finding the integer points on elliptic curves as follows.
$\bullet m=3a$
Let $X = 3\cdot2^a, Y=3n$, then we get  $Y^2 =X^3 + 36.$
According to LMFDB, this elliptic curve has $(X,Y)=(-3,\pm 3)$, $(0,\pm 6)$, $(4,\pm 10)$, $(12,\pm 42).$
Hence $(X,Y)= (12, 42)  \implies (m,n)=(6,14).$
$\bullet m=3a+1$
Let $X = 6\cdot2^a, Y=6n$, then we get $Y^2 =X^3 + 144.$
This elliptic curve has $(X,Y)=(0,12)$, then there is no natural solution $(m,n).$
$\bullet m=3a+2$
Let $X = 12\cdot2^a, Y=12n$, then we get    $Y^2 =X^3 + 576.$
This elliptic curve has $(X,Y)=(-8 , 8 ), (0 , 24 ), (12 , 48 ), (24 , 120 ), (160 , 2024 ).$
Hence $(X,Y)= (12 , 48)  \implies (m,n)=(2,4).$
$(X,Y)= (24 , 120)  \implies (m,n)=(5,10).$
Thus, there are only natual solutions $(m,n)=(2,4),(5,10),(6,14).$
</s>