There are n lockers in a hallway, numbered in order from 0 to n-1.
Initially, all the locker doors are closed. You begin at locker O and open it, then
start opening every three lockers. That is, you open lockers 0, 3, 6, 9 ...
After reaching the end of the hallway, you return to locker Q. You begin
alternating the state of each locker in the following sequence, 0, 1, 3, 6, 10, 15,
21, 28.... In other words, you continue to increase the number of lockers you
skip each time you open/close one of the lockers.
For example, since locker 3 was opened in the previous pass, you close it. But
since locker 10 remained closed, now you open it.
After both passes, how many lockers remain closed if n = 10077?