Fun one! It made me wonder how many times the students would have to run through this exercise until all of the lockers were closed again.
The answer is one more full iteration of 1,000 students. Seemed like that couldn't possibly be correct, and I thought I must've done something wrong when configuring my macro. But it turns out that this is just a beautiful case of symmetry