MathDB
MTRP 2013 Senior Paper Question 2

Source:

January 14, 2024
MTRP2013

Problem Statement

There are 1000 doors D1,D2,...,D1000D_1, D_2, . . . , D_{1000} and 1000 persons P1,P2,...,P1000P_1, P_2, . . . , P_{1000}. Initially all the doors were closed. Person P1P_1 goes and opens all the doors. Then person P2P_2 closes door D2,D4,...,D1000D_2, D_4, . . . , D_{1000} and leaves the odd numbered doors open. Next P3P_3 changes the state of every third door, that is, D3,D6,...,D999D_3, D_6, . . . , D_{999} . (For instance, P3P_3 closes the open door D3D_3 and opens the closed door D6, and so on). Similarly, PmP_m changes the state of the the doors Dm,D2m,D3m,...,Dnm,...D_m, D_{2m}, D_{3m}, . . . , D_{nm}, . . . while leaving the other doors untouched. Finally, P1000P_{1000} opens D1000D_{1000} if it was closed or closes it if it were open. At the end, how many doors will remain open?