At a school with 1000 students and 1000 lockers, Student 1 has locker 1 and so on. Student 1 decides to open all 1000 lockers. Student 2 then decides to go to every second locker and close it. Student 3 then goes to every third locker and if the locker is opened they close it. If it is closed, student 3 opens it. Student 4 changes the condition of every fourth locker; if it is opened student 4 closes it and if it is closed, student 4 opens it. The process continues all the way through student 1000 who changes the condition of the 1000th locker. In a world of N lockers which lockers stay open?
the prime lockers
Student 1 opens locker 2 Student 2 closes locker 2
2 is prime, so it's not the prime lockers
well the composites
so the composites?
oh haha thanks!
more specifically, which composites?
oop.... 1 is neither prime nor composites... so it can't be composites...
this is a question for pepper0331 to think about
oh... i tried to think about it. i don't know how to go about solving it
List the factors of the first few positive integers 1: 1 2: 1, 2 3: 1, 3 4: 1, 2, 4 5: 1, 5 6: 1, 2, 3, 6 7: 1, 7 8: 1, 2, 4, 8 9: 1, 3, 9 Notice anything?
wait i dnt know what does that have to do with the question?
The factors of each locker are the students who open/close them
Ex: look at locker 8 student 1 opens locker 8 student 2 closes locker 8 student 4 opens locker 8 student 8 closes locker 8
Does that make sense?
ohhh ya
So which lockers stay open?
perfect ...
wait i dnt know. the ones that end with 4?
Notice how 1 has only 1 factor 4 has 3 factors (1, 2, 4) 9 has 3 factors (1, 3, 9) If you keep going... 16 has 5 factors (1, 2, 4, 8, 16) 25 has 3 factors (1, 5, 25) So the rule is this: If a locker number has an odd number of factors, then it will stay open at the end. All perfect squares have an odd number of factors. So all the perfect square lockers will stay open
OH... thank you!
you're welcome
Join our real-time social learning platform and learn together with your friends!