text: Student #1 represents a factor of 1... in other words, he opens all 1000 lockers (that have 1 as a factor)\nStudent #2 represents a factor of 2... in other words, he toggles all lockers that have 2 as a factor (2, 4, 6, 8, etc.)\nStudent #3 represents a factor of 3... he toggles all lockers that have 3 as a factor...\n\nNow think of a specific locker, say #12.  It has the following factors:\n1, 2, 3, 4, 6, 12\nThat's an even number of factors, opened, closed, opened, closed, opened, closed.  So it will end up closed.\n\nTry another locker, say #20.  It has the following factors:\n1, 2, 4, 5, 10, 20... again an even number of factors, so it will end up closed.\n\nIn fact, most numbers have an even number of factors.  Generally factors pair up... so for 20 you have:\n1 x 20 = 20\n2 x 10 = 20\n4 x 5 = 20\n\nThe exceptions are the *perfect squares* because they end having one number that doesn't pair up (except with itself).\n\nSo locker #1, for example.  The only factor is 1, so it is open.\nLocker #4, has factors of 1, 2, 4 which is odd.  So again it is open.\nLocker #9, has factors of 1, 3, 9 which is odd.  So again it is open.\nLocker #16, has factors of:\n1 x 16\n2 x 8\n4\nOdd number of factors, so it will be open.\n\nThe answer is only the lockers that are *perfect squares* will be open.  Specifically the open lockers are:\n1, 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.