Lab 1670 - Lightbulbs

Description

You are standing at the start of a very long hallway, longer than the eye can see. Along the midline of its ceiling there are light bulbs, spaced one foot apart. A string hangs from each light bulb. A pull of the string turns the light bulb on, another pull turns it back off.

A student begins walking down the hall and pulls every single string (1, 2, 3..), turning all the light bulbs on. A second student begins walking down the hall and pulls every second string (2, 4, 6...) thereby turning off each of these light bulbs. Then a third student follows the other two, pulling every third string (3, 6, 9...) thereby turning some light bulbs on and some others off. A fourth student follows pulling every fourth string, then a fifth and so on, and eventually students are only pulling strings farther away than you can see.

Of the first 100 light bulbs, which ones are on?


Copyright © 2010 by Asylum Computer Services LLC Return to CS Labs