Let A and B be two positive integers greater than $0$. Is it possible that $2^{2A}+2^{2B}$ is a square number?

I am having trouble with this exercise because I get the feeling the answer is no, but I cannot elaborate on the proof. So far what I thought was to assume that there is some integer $C>0$ such that $2^{2A}+2^{2B}=C^2$. Then $$(2^A+2^B)^2=C^2+2^{A+B+1}$$ I was trying to see if the previous expression could hold a contradiction but I got stuck. All I could find is that $C$ needs to be an even number but that doesn't seem to get me anywhere. I'd appreciate any help.

Thanks in advance!

  • 1
    $\begingroup$ Can you prove that $4^{A-B}+1$ is never a square? $\endgroup$ Aug 15, 2020 at 16:38
  • $\begingroup$ Is there a certain reason you wrote "even powers of 2" instead of "powers of 4"? (At first I thought you meant "powers of 2 which are even numbers," or, in other words, "powers of 2 other than 1.") $\endgroup$ Aug 16, 2020 at 4:25
  • $\begingroup$ You were close to something when considering $C$ being even, that is basically looking at the equation modulo $2$. Turns out, a really simple solution arise when you look at it modulo $3$ (see below). $\endgroup$
    – Sil
    Sep 5, 2020 at 7:04

5 Answers 5


Without loss of generality, let $A>B$. Then $2^{2A}+2^{2B}=2^{2B}(2^{2A-2B}+1)$ is a square implies $2^{2A-2B}+1$ is a square as $2^{2B}$ is a square. But this is impossible since $2^{2A-2B}$ is a square.


Shubhrajit Bhattacharya's answer gives a simple, direct proof that $2^{2A}+2^{2B}$ cannot be a square. But just for fun, let's finish off the OP's approach (which I initially thought led to a dead end).

If $(2^A+2^B)^2=C^2+2^{A+B+1}$, then $(2^A+2^B+C)(2^A+2^B-C)=2^{A+B+1}$, which means that $2^A+2^B+C$ and $2^A+2^B-C$ are both powers of $2$, and obviously different powers of $2$, say $2^a$ and $2^b$ with $a\gt b$ and $a+b=A+B+1$. But this implies


If we now assume, without loss of generality, that $A\ge B$, we have


Now $a\gt b$ implies $2^{a-b}+1$ is an odd number greater than $1$, from which it follows that we must have $A\gt B$ (otherwise the left hand side is a power of $2$, not a multiple of an odd number greater than $1$). This in turn implies $b=B+1$ and $a-b=A-B$, from which we get


in contradiction to $a+b=A+B+1$.

Remark: I was a little surprised by the nature of the contradiction here, and had to check my work carefully to make sure I hadn't made a stupid arithmetic mistake.


Just do it.

Assume without loss of generality that $A \le B$ so

$2^{2A} + 2^{2B}=$

$2^{2A} (1 + 2^{2B-2A})=$

$(2^A)^2 [1 + 2^{2B-2A}]=$

$(2^A)^2 [(2^{B-A})^2 + 1]$.

So if that is a perfect square then we must have $(2^{B-A})^2 + 1$ being a perfect square.

But $(2^{B-A})^2$ is a perfect square so we have two consecutive perfect squares. It should be easy to convince yourself that the only time that ever occurs is $0^2$ and $1^2$. (Proof as addendum).

So the only way this can happen is if $(2^{B-A})^2 = 0$ and $(2^{B-A})^2 + 1=1$.

But $2^{B-A} = 0$ is not possible.


Addendume: Then only two consecutive squares are $0$ and $1$.

Proof: Suppose $m^2 = n^2 + 1$. where $m,n$ are non-negative integers. $n^2 < m^2 = n^2 + 1 \le n^2 + 2n + 1= (n+1)^2$ so $n < m \le m+1$. But the only integers between $n$ (exclusive) and $n+1$ (inclusive) is $n+1$ so $m = n+1$. And so $n^2 + 1 = m^2 = (n+1) = n^2 + 2n + 1$ so $2n = 0$ and $n = 0$ and $m =1$.


Assume that $2^{2A}+2^{2B}$ is a perfect square. Without loss of generality, assume $A \geqslant B$. Then, let $A-B=x$, where $x$ is a non-negative integer. It follows that we have: $$2^{2A}+2^{2B}=(2^B)^2 \cdot (2^{2x}+1)$$ Now, if the LHS is a perfect square, then the RHS must also be a perfect square. It follows that $2^{2x}+1$ is a perfect square. Let this be $n^2$. We then have: $$2^{2x}=n^2-1=(n-1)(n+1)$$ Now, we need $n-1$ and $n+1$ to both be perfect powers of $2$. This can only happen for $n=3$. However, even then, we would only have $2^{2x}=8$ which is impossible as $x$ is an integer. Thus, no solutions exist.

  • 1
    $\begingroup$ "Now, we need n−1 and n+1 to both be perfect squares. This can only happen for n=3." — Is 3-1 a perfect square? $\endgroup$
    – MarianD
    Aug 15, 2020 at 16:45
  • $\begingroup$ @MarianD sorry, that was supposed to be perfect powers of 2. Not perfect squares. I have made the edit. $\endgroup$
    – Haran
    Aug 16, 2020 at 16:20
  • $\begingroup$ Oh no! Your original sentence “It follows that $2^{2x}+1$ is a perfect powers of $2$.” was correct (not grammatically, “power” instead of “powers” :-)). Your corrected sentence is not true, sorry. $\endgroup$
    – MarianD
    Aug 16, 2020 at 17:30
  • $\begingroup$ @MarianD Lol, sorry about that, I was a bit hasty and made the edit in the wrong place. Should be fine now. $\endgroup$
    – Haran
    Aug 16, 2020 at 18:18
  • $\begingroup$ Yes, it is OK now. $\endgroup$
    – MarianD
    Aug 16, 2020 at 18:22

We would have $k^2=4^{A}+4^{B}\equiv 1+1= 2\pmod 3$, impossible as $k^2 \equiv 0,1 \pmod 3$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.