If $2^{2017} + 2^{2014} + 2^n$ is a perfect square, find $n$. If $2^{2017} + 2^{2014} + 2^n$ is a perfect square, find $n$.

My first shot would be to assume the perfect square is $2^{2018}$, but how would I prove that?  Even if it is, what is $n$?  All help is appreciated.
 A: The square is $$(2^{1007}+2^{1009})^2=2^{2014}+2^{2017}+2^{2018}$$
The answe is therefore $n=2018$
A: If you want an answer then $(a+b)^2 = a^2 + 2ab + b^2$ should suggest an obvious answer by setting $a^2 = 2^{2014}; 2ab=2^{2017}; 2^n = c^2$.  
i.e $(2^{1007} + 2^{\frac n2})^2 = 2^{2014} + 2*2^{1007}*2^{\frac n2} + 2^n= 2^{2014} + 2^{1 + 1007 + \frac n2} + 2^n$.  We just have to solve for $1 + 1007 + \frac n2 = 2017$.  So $n = 2018$.
But is it the only solution?
Bear with me.
Let $m$ be any positive integer.  Let $m = \sum_{i=0}^k a_i2^i; a_i = \{0|1\}$ but its unique binary expansion.  
Claim: If $m$ has 3 or more non-zero terms in its binary expansion then $m^2$ has more than 3 non-zero terms in its binary expansion.
Proof:  Let $m = 2^a + 2^b + 2^c + \sum_{i= c+1}^k a_i 2^i; a < b < c$.  ($a$ may equal $0$. and $a_i; i > c$ may all be $0$.)  
Then $m = (1 + 2^{b'} + 2^{c'} + \sum_{i=c+1}^k a_i2^{i - a})2^a; c'= c-a;b'=b-a$
So $m^2 = [(1 + 2^{b'} + 2^{c'} + 2*2^{b'}2^{c'}+ 2^{2b'} + 2^{c'}) + 2(1 + 2^{b'} + 2^{c'})\sum_{i=c+1}^k a_i2^{i - a} + (\sum_{i=c+1}^k a_i2^{i - a})^2]2^{2a}$.
$= 2^a + 2^b + 2^c + 2^{1+b+c}  +2^{2b} + 2^{2c} +..... $.
Note all the later terms, if they exist, are larger than $2^{2c}$ so  $m^2$ has at least four non-zero  terms in its binary expansion.
Okay...
So $2^{2017} + 2^{2014} + 2^n = m^2$ has at most three non-zero terms in its expansion.  So $m$ has at most $2$ it its expansion.
So $m = 2^k$ or $m = 2^k + 2^j$.
$2^{2017} + 2^{2014} + 2^n = 2^{2k}$ is impossible.
And $2^{2017} + 2^{2014} + 2^n = (2^k + 2^j)^2 = 2^{2k} + 2*2^j*2^k + 2^{2k}$ has only $n = 2018$ for solution.
So $n = 2018$ is the only solution.
A: $(2^x+2^y)^2=2^{2x}+2^{x+y+1}+2^{2y}$ so we can take $y=1007$ and $x=1009$ to conclude $2^{2018}+2^{2017}+2^{2014}$ is a square.

how to obtain all $n$:
$9(2^{2014})=2^{2017}+2^{2014}=k^2-2^n$.
Notice that we must have $k^2\equiv 1 \bmod 3$ implying $2^n\equiv 1\bmod 3$.
So $n=2m$.
From here we have $2^{2014}\times 9= (k+2^m)(k-2^m)=z(z+2^{m+1})$
there are now two cases, case one is when $z=9(2^j)$ and case two is when $z=2^j$
the first case is impossible because the number $9$ in binary is $1001$ and adding a power of two clearly wont make it a power of $2$. The other case is clearly only solved by taking $z=2^{1007}$ and taking $m=1009$ thus getting $z(z+2^{m+1})=2̣^{1007}(2^{1007}+2^{1010})=9(2^{2014})$.
So we need $n=2(1009)=2018$
A: The simple, fast, paper and pencil approach to find an answer (not all answers) is thus:
$$2^{2017} + 2^{2014} + 2^n$$ Factor: $$2^{2014}(2^{3} + 1 + 2^{n-2014})$$
If you factor out a perfect square from any number, the result is a perfect square if and only if the original number was a perfect square.  Therefore we can just ignore the factor $2^{2014}$ as it is a perfect square, and seek to find an $n$ such that the following is a perfect square: $$2^{3} + 1 + 2^{n-2014}$$ Simplified: $$9+2^{n-2014}$$
So the simple question is, what power of two added to $9$ results in a perfect square?
The smallest answer to this modified question* is easily found by trial and error, or by remembering the $3,4,5$ pythagorean triple, or any number of other ways:
$$9 + 16 = 25 \Rightarrow 9+2^4=25$$
Thus, we can get a possible value for $n$ using: $$n-2014=4$$
So one possible value for $n$ is $4+2014=2018$.

*This allows us to find the smallest possible value of $n$ that is greater than $2014$.  There may be a smaller answer.
A: We are going to solve a more general question: For any given natural number $k$, find the integer $n$ satisfying that
$$
2^{2k}+2^{2k+3}+2^n=m^2,
$$
where $m$ is a natural number.
Simplifying the equation to $$9\cdot 2^{2k}+2^n=m^2 \Leftrightarrow 2^n=(m+p)(m-p), $$
where $p=3\cdot 2^{k}.$
Splitting the power of $2$ yields
$$
\left\{\begin{array}{l}
m+p=2^s \cdots (1)\\
m-p=2^{n-s} \cdots (2)
\end{array}\right.
$$
for some integer $s>n-s.$
$(1)-(2)$ gives $$
3 \cdot 2^{k}=p=2^{n-s-1}\left(2^{2s-n}-1\right)  
$$
$$
\Rightarrow \left\{\begin{array}{l}
n-s-1=k \\
2 s-n=2
\end{array}\right. \Rightarrow \boxed{n=2k+4},
$$
which is the unique solution of the equation,
Back to our equation, when $2k=2014, n=2018$ is its unique solution.
