#1 (closes) - #2 (opens) - #3 (closes) - #4 (opens) - #6 (closes) - #12 (opens)
and so its end state will be open. Noticing a pattern, it is apparent that if the locker number has a number of factors that is even, its end state will be open. On the other hand, if the locker number has a number of factors that is odd, its end state will be closed. This is nice and allows one to categorize a locker by finding its factors; however, after testing this for lockers #1-#17, I noticed another pattern which greatly simplifies this process. Most numbers have an even number of factors, since they all come in pairs. There is an exception to this: perfect squares have a pair of factors that are the same. For example, 9 has a pair of factors of 3. Doing this locker problem, we only take into consideration different factors. Therefore, perfect squares have an odd number of factors, and as such a locker number that is a perfect square is closed.
To summarize for the 1000 locker problem, all perfect squares up to this number will have their respective locker number be closed. This includes locker #1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, and 961. All other locker numbers will be opened.
The following link shows my test cases: Drive Spreadsheet
* The letters of the alphabet show the sequence of which student is changing the locker. e.g. column D is the 4th student going through each locker.
The following link shows my test cases: Drive Spreadsheet
* The letters of the alphabet show the sequence of which student is changing the locker. e.g. column D is the 4th student going through each locker.
No comments:
Post a Comment