Fun Math Puzzle

http://www.flickr.com/photos/kahunapulej/326062731/
One hundred students line up to walk by one hundred closed lockers. The first student walks by opening every locker that is closed. The second student then walks by and opens every second locker that is closed and closes every second locker that is open. The third student does the same for every third locker and the nth student does the same for every nth locker.
After all the students have walked by the lockers, how many lockers are open.
Based on the responses in our group, this is either a very easy or a somewhat difficult puzzle. It was the latter for me. It took over thirty minutes for me to find the reason and provide a proof. I personally believe that type of frustration is good and I’m working on increasing the amount of time I spend trying to solve problems before giving up and looking for the answer.