document.write( "Question 671080: lockers in a row are numbered 1,2,3,...1000. all the lockers are closed until a person walks by and opens all the lockers 2,4,6...998,1000. Then another person walks by and changes the state of every third locker. changing the state meaning opening closed lockers and closing opened lockers but only on every third locker. then, another person walks up and changes the state of every fourth locker.which lockers are closed? \n" ); document.write( "
Algebra.Com's Answer #417268 by AnlytcPhil(1806)\"\" \"About 
You can put this solution on YOUR website!
lockers in a row are numbered 1,2,3,...1000. all the lockers are closed until a person walks by and opens all the lockers 2,4,6...998,1000. Then another person walks by and changes the state of every third locker. changing the state meaning opening closed lockers and closing opened lockers but only on every third locker. then, another person walks up and changes the state of every fourth locker.which lockers are closed?
\n" ); document.write( "
\r\n" );
document.write( "To make the problem easier, let's pretend\r\n" );
document.write( "that all the lockers start out open, and a\r\n" );
document.write( "person walks by and closes them all. That\r\n" );
document.write( "person has then closed, i.e., changed the\r\n" );
document.write( "state of every locker that has a factor of\r\n" );
document.write( "1, which is EVERY locker! \r\n" );
document.write( "\r\n" );
document.write( "Now we can begin our problem, since all the\r\n" );
document.write( "lockers are now closed.  A (second) person\r\n" );
document.write( "walks by and opens the lockers 2, 4, 6, ...,\r\n" );
document.write( "998, 1000.  That person has then opened,\r\n" );
document.write( "i.e., changed the state of, every locker\r\n" );
document.write( "whose number has a factor of 2.\r\n" );
document.write( "\r\n" );
document.write( "The next (3rd) person that walks by changes the\r\n" );
document.write( "state of every locker that has a factor of\r\n" );
document.write( "3.\r\n" );
document.write( "\r\n" );
document.write( "etc., etc.\r\n" );
document.write( "\r\n" );
document.write( "So in the end if a locker has an even number\r\n" );
document.write( "of factors it will end up open and if it has \r\n" );
document.write( "an odd number of factors it will end up closed.\r\n" );
document.write( "\r\n" );
document.write( "Now we need to decide which integers have an\r\n" );
document.write( "even number of factors and which integers have \r\n" );
document.write( "an odd number of factors.\r\n" );
document.write( "\r\n" );
document.write( "For every factor, p, of N which is less than\r\n" );
document.write( "the square root on N, N/p is a factor of N\r\n" );
document.write( "which is greater than the square root of N.\r\n" );
document.write( "Also the vice-versa is true. That is, for\r\n" );
document.write( "every factor q which is greater than the\r\n" );
document.write( "square root of N, N/q is a factor of N which\r\n" );
document.write( "is less than the square root on N.    \r\n" );
document.write( "\r\n" );
document.write( "An example is, say  18.  The square root\r\n" );
document.write( "of 18 is about 4.24.  1, 2, and 3 are the\r\n" );
document.write( "factors of 18 which are less than 4.24 and\r\n" );
document.write( "therefore 18/1 = 18, 18/2 = 9, and 18/3 = 6\r\n" );
document.write( "are the factors greater than 4.24.  The three\r\n" );
document.write( "that are less than the square root and the \r\n" );
document.write( "three that are greater than the square root\r\n" );
document.write( "make 6 factors, an even number of factors.\r\n" );
document.write( "\r\n" );
document.write( "There are always the same number of\r\n" );
document.write( "factors greater than the square root of an\r\n" );
document.write( "integer as there are factors less than the\r\n" );
document.write( "square root of the integer.  So 18 has an\r\n" );
document.write( "even number of factors, 3 less than its\r\n" );
document.write( "square root and 3 greater than its square\r\n" );
document.write( "root, so that makes 6 factors, an even\r\n" );
document.write( "number of factors.\r\n" );
document.write( "\r\n" );
document.write( "So the factors less than the square root\r\n" );
document.write( "plus the factors greater than the square\r\n" );
document.write( "root will always be an even number of\r\n" );
document.write( "factors.\r\n" );
document.write( "\r\n" );
document.write( "However in the case of a perfect square,\r\n" );
document.write( "like 16, the square root of the number\r\n" );
document.write( "itself will add one more factor to the even\r\n" );
document.write( "number of factors above and below the square\r\n" );
document.write( "root. 16 has two factors below its square\r\n" );
document.write( "root, 1 and 2, and two factors above its\r\n" );
document.write( "square root, 8 and 16.  However the square\r\n" );
document.write( "root of 16 itself, which is 4, makes 16 have\r\n" );
document.write( "an odd number, 5, of factors.   \r\n" );
document.write( "\r\n" );
document.write( "So all perfect squares have an odd number of\r\n" );
document.write( "factors and all non-perfect squares have an\r\n" );
document.write( "even number of factors.\r\n" );
document.write( "\r\n" );
document.write( "Therefore the lockers that will end up\r\n" );
document.write( "closed are the lockers whose numbers are\r\n" );
document.write( "perfect squares and all the others will be open.\r\n" );
document.write( "\r\n" );
document.write( "Edwin
\n" ); document.write( "
\n" );