FactorizationMethod Intermediate

Problem - 3102

Find all positive integer $n$ such that $n^2 + 2^n$ is a perfect square.


Let $2^n + n^2=k^2$. Then $2^n=(k-n)(k+n) \implies k+n = 2^a, k-n=2^b$ where $a \ge b, a + b=n$

  • If $a = b \implies n=\boxed{0}$
  • If $a > b$, then $2n=2^a - 2^b \implies n = 2^{a-1} - 2^{b-1} \implies a + b = 2^{a-1}-2^{b-1} \implies 2a > 2^{a-1} - 2^{b-1} \ge 2^{a-2} \implies a < 6 \implies n = \boxed{6}$

report an error