# The Hall of 20,000 Lights

##### Feb 09, 2019

RAY: This next puzzler is from my "ceiling light" series.

Imagine, if you will, that you have a long, long corridor that stretches out as far as the eye can see. In that corridor, attached to the ceiling are lights that are operated with a pull cord.

There are gazillions of them, as far as the eye can see. Let's say there are 20,000 lights in a row.

They're all off. Somebody comes along and pulls on each of the chains, turning on each one of the lights. Another person comes right behind, and pulls the chain on every second light, thereby turning off lights 2, 4, 6, 8 and so on.

Now, a third person comes along and pulls the cord on every third light. That is, lights number 3, 6, 9, 12, 15, et cetera. Another person comes along and pulls the cord on lights number 4, 8, 12, 16 and so on. Of course, each person is turning on some lights and turning other lights off.

If there are 20,000 lights, at some point someone is going to come skipping along and pull every 20,000th chain.

When that happens, some lights will be on, and some will be off. Can you predict which ones will be on?

RAY: Let's number all the lights and pick one at random; let’s say number 26. Let’s figure out if it's going to be on or off. All we need to know are the factors of the number 26. What's a factor? A factor is a whole number that will divide evenly into another number, with nothing left over.

So, the factors of 26 are 1, 26, 13 and 2.

Here's why that's important. It tells us that light number 26 is going to get its chain pulled four times.

Here's how we know: when every cord gets pulled it gets turned on, right? Light number 26 gets its cord pulled again at 2, which is a factor of 26.

When every 13th chain gets pulled, light number 26 gets turned on again. And it doesn't get touched again until 26, when it gets turned off forever.

Now it's pretty obvious then that every bulb that has an even number of factors will eventually get turned off for good.

So, which lamps remain on? All those represented by a number with an odd number of factors. And those are, are you ready for this? Light bulbs 1, 4, 9, 16, 25, 36, etc.

All those numbers are called perfect squares. And only they have an odd number of factors, because one of the factors is the square root of the number in question. For example, nine has three factors, 1 and 9 and 3.