TITLE: Proving that $2^{2a+1}+2^a+1$ is not a perfect square given $a\ge5$
QUESTION [5 upvotes]: I am attempting to solve the following problem:

Prove that $2^{2a+1}+2^a+1$ is not a perfect square for every integer $a\ge5$.

I found that the expression is a perfect square for $a=0$ and $4$. But until now I cannot coherently prove that there are no other values of $a$ such that the expression is a perfect square.
Any help would be very much apreciated.

REPLY [3 votes]: I will assume that $a \ge 1$
and show that
the only solution to
$2^{2a+1}+2^a+1 = n^2$
 is
$a=4, n=23$.
This is very non-elegant
but I think that 
it is correct.
I just kept charging forward,
hoping that the cases
would terminate.
Fortunately,
it seems that they have.
If
$2^{2a+1}+2^a+1 = n^2$,
then
$2^{2a+1}+2^a = n^2-1$
or
$2^a(2^{a+1}+1) = (n+1)(n-1)$.
$n$ must be odd,
so let
$n = 2^uv+1$
where
$v $ is odd
and $u \ge 1$.
Then
$2^a(2^{a+1}+1) = (2^uv+1+1)(2^uv+1-1)
= 2^u v(2^u v+2)
= 2^{u+1} v(2^{u-1} v+1)
$.
If
$u \ge 2$,
then
$a = u+1$
and
$2^{a+1}+1
=v(2^{u-1} v+1)
$
or
$2^{u+2}+1
=v(2^{u-1} v+1)
=v^22^{u-1} +v
$.
If $v \ge 3$,
the right side is too large,
so $v = 1$.
But this can not hold,
so $u = 1$.
Therefore
$2^a(2^{a+1}+1) 
= 2^{2} v( v+1)
$
so that
$a \ge 3$.
Let
$v = 2^rs-1$
where $s$ is odd
and $r \ge 1$.
Then
$2^{a-2}(2^{a+1}+1) 
=  v( 2^rs)
$
so
$a-2 = r$
and
$2^{a+1}+1
= vs \implies 2^{r+3}+1
= vs
= (2^rs-1)s
= 2^rs^2-s
$.
Therefore
$s+1
=2^rs^2-2^{r+3}
=2^r(s^2-8)
\ge 2(s^2-8)
\implies 2s^2-s \le 17$
so
$s = 1$ or $3$.
If $s = 1$,
then
$2^{r+3}+1
=2^r-1
$
which can not be.
If $s = 3$
then
$2^{r+3}+1
=9\cdot 2^r-3
\implies 4
=9\cdot 2^r-2^{r+3}
=2^r \implies r = 2, v = 11, a = 4$
and
$2^9+2^4+1
=512+16+1
=529
=23^2
$.