Find all nonnegative integers a and b such that…

The problem is the following, and is a modified version of the 2009 British Mathematical Olympiad issue: Find all nonnegative integers a and b such that \(\sqrt{a}+\sqrt{b}=\sqrt{2020}.\)

Before looking at one possible way of solving this problem, which requires nothing more than school-level arithmetic, I want to explain why I like this problem, and problems of this nature, so much. Growing up, I loved detective/mystery novels, tv shows, movies, whatever. Being able to construct a solution based on some scattered information seemed almost like a superpower to me.

Let’s begin our solution to the problem. The first step most people would take is to square both sides of the equation. This is something we are always told to do when dealing with square roots. It’s certainly what I tried. Let’s do this with the equation as it is, so we have:

\(\left(\sqrt{a}+\sqrt{b}\right)^2=2020\)

or

\(a+b+2\sqrt{a}{b}=2020\)

Ok, so this is a little nicer, maybe. We have reduced the number of square roots, which is good, but we have also made an unintentional problem for ourselves.

This is the first thing this problem taught me. Sometimes, before jumping in and just applying a method that seems right, ask yourself:
(1) Is this indeed the best method you know for dealing with this problem?
(2) If this is the best method you know, is the problem set up in the best way for you to apply it?

Let me elaborate here. There is nothing wrong with what we have done. However, in squaring the equation, in the form it is was given, we have added in the variable square root of the product \(ab\). This has made things harder for us since we have now unintentionally muddled together the information given by the variables a and b.

What if instead we first rearranged our equation as

\(\sqrt{a}=\sqrt{2020}-\sqrt{b}\)

Then we can again square both sides, only this time we get:

\(a=2020-2\sqrt{2020b}+b\)

Notice that this time we have again reduced the number of square roots we had, but we have additionally kept the variables a and b separate. This may seem like a simple difference but it makes all the difference with how we can proceed. We now make note of the fact that all terms of our new equation are clearly integers, except potentially \(2\sqrt{2020b}\).

Here comes the second thing I learned from this problem, deductive reasoning. Since we know that adding or subtracting two integers always results in an integer, and since we can re-write our equation as

\(b-a+2020=2\sqrt{2020b}\)

we can deduce that \(2\sqrt{2020b}\) must indeed be an integer. This is a huge clue!

We first notice that

\(2020=2^2 \cdot 5 \cdot 101\)

Thus we can say that

\(\sqrt{2020b}=2\sqrt{505b}\)

So, since \(\sqrt{2020b}\) is an integer, we must have that \(\sqrt{505b}\) is an integer. It means that we must have, whit \(c \in \mathbf{N} \):

\(505b=c^2\)

But, the \(\sqrt{505}\) is not an integer, so this only makes sense if \(b=505d^2\) for \(d \in \mathbf{N}\).

So, we have:

\(505b=\left(41d\right)^2\)

or

\(b=505d^2.\)

The third thing I learned from this problem: Don’t waste your time! What I mean by this is the following, there was nothing special about moving the \(b\) across the equals sign in our original equation, we could just have easily started with the equation:

\(\sqrt{b}=\sqrt{2020}-\sqrt{a}\)

and everything would follow in the exact same way. In particular, we would arrive at a similar conclusion that \(a=505 e^2\) for some integer \(e\).

We call this a symmetric argument and really, all we are saying is that since it is clear that everything will work the exact same, if we were to replace the variable \(b\) with the variable \(a\), we are not willing to write the argument down again and instead we will just skip to the conclusion. With \(e,d \in \mathbf{N}\):

\(a= 505 e^2\) \(b=505 d^2\)

So, going back to our original equation, we have:

\(\sqrt{505e^2}+\sqrt{505d^2}=\sqrt{2020}=2\sqrt{505}\)

or

\(e\sqrt{505}+d\sqrt{505}=2\sqrt{505}\)

then

\(e+d=2\)

This is certainly a much easier equation to deal with. There are only three solutions to this equation for d and e. In particular, we can have:

\(d=0, e=2 \Rightarrow a=2020, b=0\)

\(d=1, e=1 \Rightarrow a=505, b=505\)

\(d=2, e=0 \Rightarrow a=0, b=2020\)