Diophantine equation with power Find all the integer solutions of:  
$2^{n+1} + 41 = m^2$ 
I am stuck, and I am not sure if I am going on the right path..  
adding 8 to both sides:  
$2^{n+1} + 41 + 8 = m^2 + 8$
$2^{n+1} + 49 = m^2 + 8$
$2^{n+1} - 8 = m^2 -49$
$2(2^n - 4) = (m+7)(m-7)$ 
I am not sure on how to keep going, how do I manage to solve this question?
Thank you!
 A: Some insight can be gained by looking at the equation $\bmod 40$. Note that for $n\ge 1$, the residues of $2^{n+1} \bmod 40$ are $\{4,8,16,32,24\}$ with $4$ occurring only once and the other values cycling. Since $4$ does not yield a solution ($4+41\ne m^2$), we can ignore its single occurrence. Of course,  $41\equiv 1 \bmod 40$, so we are looking for solutions to $m^2\equiv \{9,17,33,25\} \bmod 40$. No integer squared ends in the digits $3,7$, so we can further eliminate $17,33$ from consideration, leaving us to examine $m^2\equiv \{9,25\} \bmod 40$. From this, we conclude that $m$ ends in one of the digits $\{3,7,5\}$.
Case 1: $m^2\equiv 25 \bmod 40$. Then $2^{n+1}$ must end in the digits $84$. This occurs for $n+1=20k+14$. $n+1=14,34$ do not yield solutions, and for $n+1=54,74,\dots$ I am not able to calculate, so there might be solutions, but I can't say definitely yes or no.
Case 2: $m^2\equiv 9 \bmod 40$. This implies that $2^{n+1}$ ends in the digit $8$, which occurs when $n+1=4k+3$. The readily found solutions for $n+1=3,7$ are $m=7,13$. Up to $n+1=47$, no further solutions are found.
Added by edit: OP correctly points out in a comment that $n$ must be even. If $n$ is odd, then $n+1$ is even, $2^{n+1}$ is a square, and by rearranging terms, $41$ can be expressed as the difference between two squares. Since $41$ is prime, it can only be expressed as the difference between two squares in one way: $41^2-40^2=(21+20)(21-20)$. In this complexion, $m=21$, but $20$ is not a power of $2$, so $n$ cannot be odd, hence $n+1$ cannot be even, which is required in Case 1 where $n+1=20k+14$. Thus there are no Case 1 solutions, as OP states. 
