This is a classic logic problem for you to think about. You may find it helpful to represent the various scenarios in a visual way.

- A school has 1000 students and 1000 closed lockers numbered 1 to 1000.
- The first student walks along the corridor and opens every locker.
- The second student walks along and closes every second locker.
- The third student walks along and changes the state of every third locker (ie. an open locker is closed and a closed locker is opened) .
- Remaining students walk along, and the k
^{th}student change every k^{th}locker, until all 1000 students have walked along the row of lockers.

Questions:

- How many lockers are closed after the third student has passed?

- How many lockers are closed after the fourth student has passed?

- After 1000
^{th}student have passed, what is the state of the 100^{th}locker?

- After 100
^{th}students have passed, what is the state of the 1000^{th}locker?

- After 1000
^{th}students have passed, how many lockers will still be open?

Question 1:

1^{st} student = **O O O O O O O O O O O O O O O O O O O O**

2^{nd} student = **O C** O C **O C** O C **O C** O C **O C** O C **O C** O C **O C**

3^{rd} student = **O C C C O O** O C C C O O **O C C C O O** O C C C

Closed = \(3 \times 166 + 3\) = 501 closed

Question 2:

4^{th} student = **O C C O O O O O C C O C** O C C O O O O O C C O C

Closed = \(5 \times 83 + 2\) = 417 closed

Question 3:

100^{th} locker = \(2^{2} \times 5^{2}\) = 9 students = odd number = OPEN

Question 4:

1000^{th} locker = \(2^{3}\times 5^{3}\) = 16 students

but not 125^{th} , 200^{th} , 250^{th} , 500^{th} , 1000^{th} students

= \(16\) – \(5\) = 11 students = odd number = OPEN

Question 5:

Closed = even number of factors (eg 6 = 1, 2, 3, 6)

Open = odd number of factors (eg 16 = 1, 2, 4, 8, 16 or any square)

Open = n^{2} lockers, for integer n = 1 to 31

By Mike Baxter