Problems(1)
There are 1000 doors D1,D2,...,D1000 and 1000 persons P1,P2,...,P1000.
Initially all the doors were closed. Person P1 goes and opens all the doors.
Then person P2 closes door D2,D4,...,D1000 and leaves the odd numbered doors open. Next P3 changes the state of every third door, that
is, D3,D6,...,D999 . (For instance, P3 closes the open door D3 and opens
the closed door D6, and so on). Similarly, Pm changes the state of the
the doors Dm,D2m,D3m,...,Dnm,... while leaving the other doors untouched. Finally, P1000 opens D1000 if it was closed or closes it if it were
open. At the end, how many doors will remain open? MTRP2013