Math puzzle:

In the UCLA Math Department's basement, there are 100 lockers, numbered 1 to 100; the summer break also happens to be exactly 100 days long; and even the janitors are interested in numbers.

On the first day of summer, all the lockers are unlocked. The janitor then walks by and, for every locker, locks it if it was unlocked, and unlocks it if it was locked. (Since all the lockers were unlocked, that means he locks each one.)

On the second day, the janitor walks by and, for every 2nd locker starting with #2, locks it if it was unlocked, and unlocks it if it was locked. (Since all the lockers were locked after the first day, that means he unlocks each one.)

On the third day, he walks by and, for every 3rd locker starting with #3, locks it if it was unlocked, and unlocks it if it was locked. (Now, some lockers get locked and some unlocked.)

On the Nth day, of course, he walks by and, for every Nth locker starting with #N, locks it if it was unlocked, and unlocks it if it was locked.

After 100 days, how many lockers are locked?

(Click here for the answer.)