We write a = (2^r)*p and b = (2^s)*q, for some non-negative integers

r and s, and odd integers p and q.

Accordingly, we obtain:(2^r*(p))^n + (2^s*(q))^n = 2^m.

We can assume without any loss of generality that r< = s, giving:

p^n + (2^(s-r)*(q))^n = 2^(m-nr).

Since both terms on the left-hand side of the equation are positive

integers, the right-hand side must be greater than one, and hence even.

Then, p^n odd would give, (2^(s-r)*q)^n odd , so that r = s.

Hence we may cancel the factor 2^r from a and b, obtaining :

p^n + q^n = 2^t, for some positive integer t.

Case A: n is odd

We assume that at least one of p and q are different from 1.

Since n is odd, p + q is a factor of p^n + q^n.

If C = p^n + q^n = 2^t, then

A = p + q = 2^u, for some positive integer u, and

B =

p^(n-1) - p^(n-2)q + p^(n-3)q^2 - p(n-4)q^3 + ... + q^(n-1)

= 2^(t-u),

and clearly, since C > A, we have B > 1, t > u, and so B is even.

But then B is the sum of an odd number of odd terms, and so is odd,

a contradiction.

Case B: n is even

Writing n = 2w, we have (p^w)^2 + (q^w)^2 = 2^tt, and it will be

sufficient to show that we must have p^w = q^w = 1, implying p = q = 1.

Since p^w and q^w are odd, their squares are congruent to 1(Mod 4).

Hence we have 1 + 1 = 2t (mod 4), implying t = 1.

Hence p^w = q^w = 1, and p = q = 1.

In both cases we conclude that p = q = 1, which is indeed a solution

of p^n + q^n = 2^t, with t = 1.

Hence, if a^n + b^n = 2^m, a = b = 2^r is a solution. (With nr + 1 = m.)

Therefore, a^n + b^n = 2^m gives a = b, as was asked for.