The janitor at Grand high school fixe the locks on all 1000
The janitor at Grand high school fixe the locks on all 1,000 lockers so that they cannot be reopend after they are closed.
On the first day of school, all the lockers are open except locker #1.
The first student enters and walkd to the first open locker, Locker #2. He puts his book into this locker and leaves it open. But then he closes all multiples of his locker number ( 4,6,8,10,....).
The next student walks to the next open and unoccupied locker. She claims this locker, leaves it open, and closes all multiples of her locker number.
Students continue to enter one at a time, each one claiming the next open and unoccupied locker. They each leave their locker open but close all multiples of their locker number.
After all students have entered, which lockers are open and which are closed? show your thinking
Solution
The first student enters and walkd to the first open locker, Locker #2. He puts his book into this locker and leaves it open. But then he closes all multiples of his locker number ( 4,6,8,10,....).
Here we get our First open locker : Locker #2
The next student walks to the next open and unoccupied locker : Locker #2
He puts his book into this locker and leaves it open. But then he closes all multiples of his locker number ( 6,9,12,15,....).
Here we get our second open locker : Locker #3
The next student walks to the next open and unoccupied locker : Locker #5
He puts his book into this locker and leaves it open. But then he closes all multiples of his locker number ( 10,20,25,35,....).
Here we get our third open locker : Locker #5
The next student walks to the next open and unoccupied locker : Locker #7
He puts his book into this locker and leaves it open. But then he closes all multiples of his locker number ( 49,77,....).
Here we get our third open locker : Locker #5
The next student walks to the next open and unoccupied locker : Locker #11
as we the see the series2, 3,5,7,11,...... all being primes because the have no divisors except 1 and themselves
as locker 1 is closed the open lockers are the ones that students put their books in will all be primes
Hence the open lockers are2,3,5,7,11,13,17,19,23,.....997
