Prize winners for a giveaway program are to be determined as follows: Envelopes for the first 500 entries will be numbered 1 through 500 and laid on a long table. The first official will walk along the table, opening all the envelopes. The second official will follow the first and close every even-numbered envelope. The third official will follow the second, reversing every third envelope by closing open envelopes and opening closed envelopes. The fourth official will reverse every fourth envelope, and so on until 500 officials have walked along the table and reversed envelopes. The envelopes that remain open after this procedure will be those of the contest winners. What numbers were on the winning envelopes?

1 answer

Perhaps this just about identical problem will give you a clue
Read it carefully

https://www.wyzant.com/resources/answers/233973/there_are_1_000_students_and_lockers_in_a_school_the_first_student_opens_every_locker_with_an_even_locker_number_how_many_lockers_will_be_left_open