Lights Out

This is one of those math puzzles that come up in contests but which turn out to be quite interesting mathematically. Imagine a long hallway with lights in the ceiling, all on and each controlled by its own chain. A long line of people (as many as there are lights) walk down the hallway. The first one pulls every chain, the second one every other chain, the 3rd pulls every 3rd chain and so on. When all the people have walked down the hallway, what lights, if any, will still be lit? What more can you learn from this puzzle about multiplication?