Summer Institute For The Gifted
Classes taught by Maureen L Greenbaum

Drew University
June 30 - July 20, 2002

Home
Art
Web Design
Programming

Mail

THE LOCKER-REVERSAL PROBLEM

At the Lincoln Park High School there are exactly 1000 lockers (numbered 1 through 1000). The student body at Lincoln Park High School numbers exactly 1000 students. On the opening day of class in September the students line up in front of the school, single file. All 1000 are present. They conduct the following procedure:

The first student enters the building and reverses each locker. (Reversing a locker simply means that you close a locker that is open and you open a locker that is closed).

When the first student is finished reversing each locker the second student enters the building and reverses the lockers 2, 4, 6, 8, ...., Etc.

When student 2 is finished the third student enters the building and reverses the lockers 3, 6, 9, 12, ......Etc.

When student 3 is finished the fourth student enters the building and reverses the lockers 4, 8, 12, 16, Etc.

When student 4 is finished the fifth student enters the building and reverses the lockers 5, 10, 15, 20, Etc.

In general, the n th student, upon his/her turn, enters the building and reverses lockers numbered n, 2n, 3n, 4n, ......

The process continues right on through the one thousandth student. All the lockers are closed prior to the first student entering the building. The problem is how many lockers are open after the last student, student number 1000, has finished the reversal process? This problem comes from Dr. Philip Zipse, the Founder and Director of the Summer Institute For The Gifted. E-mail your answers to him at: pzipse@cgp-sig.com
************************************************************************
 

Javascript Solution