Skip to main content
1-Visitor
April 1, 2010
Question

Lockers

  • April 1, 2010
  • 2 replies
  • 11729 views
Our local High School posed the following to High School students:

There are 1000 Lockers in a High School with 1000 students.
The first student opens all lockers.
The second student closes all even number lockers (2,4,6,8...)
The third student toggles every third locker. (Toggle= Close if open or Open if closed)
The fourth student toggles every fourth locker. (4,8,12,...)
The fifth student toggles every fifth locker (5,10,15...)
...
The nth student toggles every nth locker (n,2n,3n...)
This continues until all 1000 students have had a turn.
==================================================
Question 1 : How many lockers are open at the end of this excercise?

Question 2: What is the general answer for N lockers and N students?

2 replies

12-Amethyst
April 1, 2010
Answer to question 1, but can't generalize yet, but it is, following Eratostenes, the nearest by the left prime of the square root of the N.

Regards. Alvaro.
1-Visitor
April 1, 2010
>>following Eratostenes<<

No. Eratostenes only sieves out primes. The process here uses all numbers, composites as well as primes. Whether a door ends up open or closed depends on wheter it has an even or odd number of divisors.
__________________
� � � � Tom Gutman
12-Amethyst
April 1, 2010
For this is for what I only answer the question 1 and make a conjeture about question 2.

Regards. Alvaro.
1-Visitor
July 4, 2010

I don't know if the OP has moved on or not, but I decided to give it a try. Came up with a similar method and arrived at the same answer as the others. Not sure on question 2 though. : )

1-Visitor
July 4, 2010

Thanks Stephen,

Looks interesting for spare time. Hard to visualized the entire process.

and especially where it turns recursive. I was wondering [in case you

are not sure of the solutio] if you could plug the first numbers in the

Neil Sloane/Simon Plouffe series. If there is a series, therefore a

solving module, it will find among their ziliion series solutions.

Try that one !

Triangle.gif

jmG

1-Visitor
July 4, 2010

The triangle problem is old and a trivial problem:

triangle.gif

The triangles are not similar to the bounding triangle. The "missing " square is the same area as the mismatch between the two small triangles and the bounding triangle.