MathDB
Change or not change the doors

Source: Brazil National Olympiad Junior 2021 #1

February 8, 2022
combinatorics

Problem Statement

In a school there are 20212021 doors with the numbers 1,2,,20211,2,\dots,2021. In a day 20212021 students play the following game: Initially all the doors are closed, and each student receive a card to define the order, there are exactly 20212021 cards. The numbers in the cards are 1,2,,2020,20211,2,\dots,2020,2021. The order will be student 11 first, student 22 will be the second, and going on. The student kk will change the state of the doors k,2k,4k,8k,,2pkk,2k,4k,8k,\dots,2^pk with 2pk20212p+1k2^pk\leq 2021\leq 2^{p+1}k. Change the state is if the door was close, it will be open and vice versa. a) After the round of the student 1616, determine the configuration of the doors 1,2,,161,2,\dots,16 b) After the round of the student 20212021, determine how many doors are closed.