Hi,
My math gave me this question to solve saying tha it was apparently "one of the hardest questions in the world".
I already solved it, but I was wondering if I was right or no.
Could someone please try this out and send me your answers, so that I know if I'm right or not? :3
There is a school with 1,000 students and 1,000 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 thousandth student. How many lockers are open at the end?
Brian Phillips
Let's try this with just 9 lockers......I think you might see the answer
After the second student goes through......
O C O C O C O C O
After the third student goes through
O C C C O O O C C
After the 4th
O C C O O O O O C
After the 5th
O C C O C O O O C
After the 6th
O C C O C C O O C
After the 7th
O C C O C C C O C
After e 8th
O C C O C C C C C
After the 9th
O C C O C C C C O
Notice that, after the 9th person, lockers 1, 4 and 9 are open........what are those numbers???
Perfect squares !!!
And the number of perfect squares from 1 - 1000 = 31
So......31 lockers will be open at the end.......and the rest closed
The reason for this is that all non-squared integers have an even number of proper and improper divisors ......thus......they will have some number of O-C pairings and have the state of "C" at the end of the process....consider the number 6......it is open on the first pass.....closed on the second, open on the third and closed on the sixth....thus, it has the states O-C and O-C
Squared numbers, on the other hand, always have an odd number of proper and improper divisors......they will have the state of "O" at the end.......consider 9.....
It is opened on the first pass, closed on the third and opened again on the ninth....and it is never touched after that !!!!!