Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site dspo.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!philabs!cmcl2!lanl!dspo!tallman From: tallman@dspo.UUCP Newsgroups: net.puzzle Subject: Re: 1000 Lockers (SPOILER) Message-ID: <215@dspo.UUCP> Date: Tue, 23-Apr-85 13:18:06 EST Article-I.D.: dspo.215 Posted: Tue Apr 23 13:18:06 1985 Date-Received: Fri, 26-Apr-85 03:28:58 EST References: <233@bbnccv.UUCP> Organization: Los Alamos National Laboratory Lines: 22 > Lining the corridor of a school are 1000 lockers. The first student > to arrive at school one morning decides to open the doors to all 1000 > lockers. The second student to arrive that morning decides to go down > the hall and close the door of every second locker... > As the students arrive, this process continues...until the 1000th > student... Now, after all this has been done, which lockers are open, > which are closed, and why? All lockers whose numbers are perfect squares will be open (1,4,9...) and all others will be closed. The reasoning is as follows - A locker will be closed if it has an even number of divisors including itself and 1. It will be open if it has an odd number. Suppose a number n has a divisor k. Then it also has a divisor n/k. So all divisors of n pair up, unless there exists k = n/k, i.e. n is the perfect square k*k. -- C. David Tallman - dspo!tallman@LANL or {ucbvax!unmvax,ihnp4}!lanl!dspo!tallman Los Alamos National Laboratory - E-10/Data Systems Los Alamos, New Mexico - (505) 667-8495