Let a, b, n, and m be positive integers, with n > 1. Show that a^{n} + b^{n} = 2^{m} a = b.

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.

We thus have (2^{r}p)^{n} + (2^{s}q)^{n} = 2^{m}.

Without loss of generality, assume r s, so that 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 (2^{s−r}q)^{n} odd 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.

Our aim is to show that p = q = 1. We consider odd and even n separately.

We assume not both p and q are equal to 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.

We conclude that the only possible solution is p = q = 1.

Writing n = 2w, we have (p^{w})^{2} + (q^{w})^{2} = 2^{t}, 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, modulo 4.

Hence we have 1 + 1 = 2^{t} (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} a = b, as required.

Source: Inspired by Sum of two 23rd powers as a power of 2 on the projecteuler.net forum