Solve an equation with integer variables 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 ? 

Suppose $n > 2$.  We have $m^2 -1 = (m-1)(m+1)\equiv 0 \mod 2^n$, so one of $m-1$ and $m+1$ is divisible by $2^{n-1}$ (the other is divisible by $2$ but no higher power of $2$).  By symmetry $m \to -m$, we may assume it is $m-1$.  Thus
$m = 1 + k 2^{n-1}$.  With this substitution the equation becomes
$$ 2^{2n} \left(2 - \frac{k^2}{4}\right) + (1-k) 2^n = 0$$
or 
$$ 2^{n-2} = \frac{k-1}{8-k^2}$$
Now $\gcd(k-1,8-k^2) = \gcd(k-1,8-k) = \gcd(k-1,7)$ is either $1$ or $7$.
$k-1$ must be even, so $k$ is odd and $8-k^2$ is odd (and can only be $\pm 1$ or $\pm 7$).  Only for $k=-3$ do we get $(k-1)/(8-k^2) = 4 $ a power of $2$.  This corresponds to the solution $n = 4$, $m = 1 - 3 \cdot 2^3 = -23$.
