I am trying to find all the integers $(n,m)$ such that $$2^{2n+1} + 2^n + 1 = m^2$$.
With a simple python program, I find that $n=0$, $n=4$ are the only solutions less than $50$. However with the precision of number I can not get accurate results when $n > 50$. Does any one have an idea which could help me to solve this equation ?
Without loss of generality, we may assume that $m$ and $n$ are non-negative. We begin by rearranging the equation to read as follows: $$ 2^n(2^{n+1}+1)=(m-1)(m+1) $$ This implies that $2^{n-1}$ exactly divides either $m-1$ or $m+1$. If it is the case that $2^{n-1}$ exactly divides $m-1$, we can write $m-1=k2^{n-1}$ for some odd natural number $k$. If $k\geq 3$, then: $$ (m-1)(m+1)=k2^{n-1}(k2^{n-1}+2)=k^22^{2n-2}+k2^n\geq 9\cdot2^{2n-2}+3\cdot 2^{n}> 2^{2n+1}+2^n $$ This is a contradiction. Thus, we know that $2^{n-1}$ exactly divides $m+1$. Write $m+1=k2^{n-1}$ for some odd natural number $k$. If $k\geq 3$, then we see the following: $$ (m-1)(m+1)=(k2^{n-1}-2)k2^{n-1}=k^22^{2n-2}-k2^n\geq 9\cdot 2^{2n-2}-3\cdot 2^n $$ The RHS of this chain inequality, $9\cdot 2^{2n-2}-3\cdot 2^n$, is greater than $2^{2n+1}+2^n$ if $n>4$. Thus, aside from the solutions $(m,n)=(2,0)$ and $(m,n)=(23,4)$, the only possible solutions are of the form $(2^{n-1}\pm 1,n)$, which obviously do not satisfy the Diophantine equation.
Therefore the only two solutions are the two that have already been found in the original posting of the problem.
EDIT: I forgot to mention you have to exhaustively search over the $n=0$ to $n=4$ range to complete the proof. Oops.