For which integer $n$ is $28 + 101 + 2^n$ a perfect square? This question
For which integer $n$ is $$28 + 101 + 2^n$$ a perfect square. Please also suggest an algorithm to solve similar problems. Thanks
Btw, this question has been taken from an Aryabhatta exam for 8th graders in India. 

One way is to notice that 
$28+101+2^n=128+1+2^n=2^7+1+2^n=2^n+2*2^6+1$. 
Therefore, if we let $n=12$ we have 
$2^{12}+2*2^6+1=(2^6)^2+2*2^6+1=(2^6+1)^2$
Which is a perfect square, as desired.
This relies on noticing this specific pattern, so doesn't lend itself to a general method. One could always guess and check.
