Recently, I’ve been wondering about natural solutions of equation

x2 + 7 = 2n

While I’m still working on it, let’s find all natural solutions of similar equation

x2 + 1 = 2n

using the same methods of simple algebraic number theory as before. This time my post is rather short.


We will work in the ring Z[i] of Gaussian integers. It is a ring consisting of elements of form a + bi with a and b being ordinary integers. It is a Unique Factorisation Domain.

Let’s prove that there are no natural numbers (x, n) different from (1,1) satysfying

x2 + 1 = 2n

Indeed, this equation is equivalent to

(x + i)(x – i) = (1 + i)n(1 – i)n

Now, what is the Greatest Common Divisor of x+i and x-i? These two numbers are complex conjugates of each other, so it’s easy to see that their GCD must be 2k. But 2k doesn’t divide x+i, for k>0, so we conclude that x+i and x-i are relatively prime. So, using that 1+i and 1-i are primes (for a similar reason I described before), we see that if x and n satisfy our equation then

x+i = (1+i)n

(or … = (1-i)n, but it doesn’t make real difference further). (There are many different ways of ending the reasoning now – you may want to try to do it yourself!) Now, let’s define sequences an and bn by

(1+i)n = an + bni

It’s not hard to see that bn satisfies recurrence relation

bn+2=2bn+1 – 2bn

with two first terms equal to 1 and 2.

So, the only odd bn is b1=1. In particular, the only n for which

x+i = (1+i)n

might hold is n=1. And indeed, this gives rise to our only solution: x=1, n=1.


Let me remind that for finding all solutions to

x2 + 7 = 2n

it’s enough to prove that the sequence

b1=1, b2=1, bn+2 = bn+1 – 2bn

doesn’t have any +-1 for n>13.