2018 NSW: Maths Puzzle 1

Dr Henry Wiggins

1st puzzle by Dr Harry Wiggins

There is a school with 2018 students and 2018 lockers. On the first day of term the headteacher asks the first student to go along and open every single locker, he asks the second to go to every second locker and close it, the third to go to every third locker and close it if it is open or open it if it is closed, the fourth to go to the fourth locker and so on. The process is completed with the 2018th student. How many lockers are open at the end?








Leave your comment
6/24/2018 8:55 PM
My son's solution follows:
For a door to be open, the number of the door must have an odd amount of factors. Since square numbers are the only numbers that have a repeated pair of factors. The only doors open will be the doors with a square number. Since 45 squared is 2025 (>2018) and 44 squared is 1936 (<2018), the answer is 44.
7/30/2018 1:28 PM
Good solution Celeste. Can you generalize it to N students and N lockers?
7/30/2018 4:45 PM
For a locker to remain open, its number of factors must be odd, as it starts closed, and alternates between open and closed for each factor added. Only square numbers have an odd number of factors, and the highest square number lower than 2018, is 1936=44^2, thus the answer is 44.
For N lockers and N students, the answer is by the same reasoning the greatest square <= N  which is equal to floor(n^(1/2))^2.
Sachin Reddy Northwood School
7/31/2018 3:04 PM
Correct, since 44*44 < 2018 < 45*45.