The evil wizard MoldeVort has been trying to kill you for years, and today it looks like he’s going to succeed. But your friends are on their way, and if you can survive until they arrive, they should be able to help stop him. Can you keep MoldeVort trapped long enough for help to arrive? Dan Finkel shows how.

**Transcript:**

The evil wizard MoldeVort has been trying to kill you for years, and today it looks like he’s going to succeed. But your friends are on their way, and if you can survive until they arrive, they should be able to help stop him.

The evil wizard’s protective charms ward off every spell you know, so in an act of desperation you throw the only object in reach at him: Pythagoras’s cursed chessboard.

It works, but with a catch. MoldeVort starts in one corner of the 5×5 board. You have a few minutes to choose four distinct positive whole numbers. MoldeVort gets to say one of them, and if you can pick a square on the board whose center is exactly that distance away, the curse will force him to move to that spot. Then he’ll have to choose any of the four numbers, and the process repeats until you can’t keep him inside the board with legal moves. Then he’ll break free of the spell and almost certainly kill you.

What four numbers can you choose to keep MoldeVort trapped by your spell long enough for help to arrive? And what’s your strategy?

The trick here is to keep MoldeVort where you want him. And one way to figure out how to do that is to play out the game as MoldeVort would: always trying to escape.

You’re dealing with a relatively small board, so the numbers can’t be too big. Let’s start by trying 1, 2, 3, 4 to see what happens.

Moldevort could escape those numbers in just three moves. By saying 2, then 3, he would force you to let him into one of the middle points of the grid, and then a 4 would break him free. But that means you’ll need to allow a number larger than 4, which is the distance from one end of a row to another. How is that even possible?

Through diagonal moves. There are, in fact, points that are distance 5 from each other, which we know thanks to the Pythagorean Theorem. That states that the squares of the sides of a right triangle add up to the square of its hypotenuse. One of the most famous Pythagorean triples is 3, 4, 5, and that triangle is hiding all over your chessboard. So if MoldeVort was here, and he said 5, you could move him to these spaces.

There’s another insight that will help. The board is very symmetrical: If MoldeVort is in a corner, it doesn’t really matter to you which corner it is. So we can think of the corners as being functionally the same, and color them all blue. Similarly, the spaces neighboring the corners behave the same as each other, and we’ll make them red. Finally, the midpoints of the sides are a third type. So instead of having to develop a strategy for each of the 16 spaces on the outside of the board, we can reduce the problem to just three. Meanwhile, all the inside spaces are bad for us, because if MoldeVort ever reaches one, he’ll be able to say any number larger than 3 and go free. Orange spaces are trouble too, since any number except 1, 2, or 4 would take him to an inside space or off the board. So orange is out and you’ll need to keep him on blue and red.

That means 2 is bad, since it could take MoldeVort to orange on the first turn. But the four other smallest numbers, 1, 3, 4, and 5, might work. Let’s try them and see what happens. If MoldeVort says 1, you can make him go from blue to red or red to blue. And the same works if he says 3. Thanks to our diagonals, this is even true if he says 5.

If he says 4, you can keep him on the color he’s already on by moving the length of a row or column. So these four numbers work! Even if your friends don’t get here right away, you’ll be able to keep the world’s most evil wizard contained for as long as you need.