Problem Statement: Process:

Wendy Wong
August 7, 2006
Math 510
Avi Barr
Problem of the Week #6: The Locker Problem
Problem Statement:
The task is to figure out which lockers will be open at the end of a process when students take turns closing
and opening lockers numbered from 1 to 100. The first student closes all lockers that are multiples of 2, the
next closes all the lockers that are multiples of 3 and opens them if they are closed already, the next student
does the same for lockers that are multiples of 4, and so on. The last student changes only locker number
100 since that is the only locker that is a multiple of 100.
After determining which lockers end up open at the end of the process of 100 students, you need to predict
which lockers would end up open if the lockers went up to 1000.
Process:
I first approached this problem by making an organized table to see which lockers from 1-10 will be open as
I go through the multiples of 2 to 10. I found the following:
1
Open
2
Open
Close
Open
3
Open
4
Open
Close
5
Open
Close
Never touched—
stays open
Locker Number
Start
Multiples of 2
Multiples of 3
Multiples of 4
Multiples of 5
Multiples of 6
Multiples of 7
Multiples of 8
Multiples of 9
Multiples of 10
End of Process
6
Open
Close
Open
7
Open
8
Open
Close
9
Open
10
Open
Close
Close
Open
Open
Close
Open
Close
Close
Close
Open
Close
Close
Open
Close
Close
Close
Close
Open
Close
Close
Right away, I noticed that only lockers number 1, 4, and 9 are open at the end of the process, for after their
number is passed (the student opening or closing the multiples of their number), the locker will not be
changed again. Because locker number 1 is never touched, that locker is discounted. When a locker is
changed, it is because the locker is a multiple of the number a student has in mind, and the numbers that
students have in mind are all divisors of a locker that is changed. For example: a student that is changing all
lockers that are multiples of 2 touch the lockers that are multiples of 2, and all the lockers touched have 2 as a
divisor.
Students with number 2, 5, and 10 in mind touch locker number 10, and 10 has 2, 5, and 10 as divisors.
Coincidentally, 4 and 9 have 2 divisors other than 1: itself and its square root. All square numbers have an
odd number of divisors because when their factor pairs are listed, their square root is repeated in the factor
pair. So all square numbers will be touched an even number of times while all other numbers, whether prime
or composite will be touched an odd number of times, resulting with all square numbers staying open at the
end (closed, then opened).
Locker
Number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Factor Pairs
1x1
1x2
1x3
1 x 4, 2 x 2
1x5
1 x 6, 2 x 3
1x7
1 x 8, 2 x 4
1 x 9, 3 x 3
1 x 10, 2 x 5
1 x 11
1 x 12, 2 x 6, 3 x 4
1 x 13
1 x 14, 2 x 7
1 x 15, 3 x 5
1 x 16, 2 x 8, 4 x 4
1 x 17
1 x 18, 2 x 9, 3 x 6
1 x 19
1 x 20, 2 x 10, 4 x
5
1 x 21, 3 x 7
1 x 22, 2 x 11
1 x 23
1 x 24, 2 x 12, 3 x 8,
4x6
1 x 25, 5 x 5
Number
of
Divisors
Number times
touched
Process
End of the
Process
1
2
2
3
2
4
2
4
3
4
2
6
2
4
4
5
2
6
2
0
1
1
2
1
3
3
3
2
3
1
5
1
3
3
4
1
5
1
Open, not touched
Open, close
Open, close
Open, close, open
Open, close
Open, close, open, close
Open, close
Open, close, open, close
Open, close, open
Open, close, open, close
Open, close
Open, close, open, close, open, close
Open, close
Open, close, open, close
Open, close, open, close
Open, close, open, close, open
Open, close
Open, close, open, close, open, close
Open, close
Open
Closed
Closed
Open
Closed
Closed
Closed
Closed
Open
Closed
Closed
Closed
Closed
Closed
Closed
Open
Closed
Closed
Closed
6
5
Open, close, open, close, open, close
Closed
4
4
2
3
3
1
Closed
Closed
Closed
8
7
3
2
Open, close, open, close
Open, close, close
Open, close
Open, close, open, close, open, close,
open, close
Open, close, open
Closed
Open
Solution:
Because square numbers, or perfect squares, have an odd number of divisors, they will be touched by an even
number of students. All other numbers have an even number of divisors and will be touched an odd number
of times. The odd time that a locker is changed will always be closing the locker, and the even time that a
locker is changed will be opening the locker again. The number of times a locker is touched or changed is
exactly one less than the number of divisors it has; therefore, a number with 8 divisors will be touched 7
times. The first, third, fifth, and last time it is touched is closing the locker, and the second, fourth, and sixth
times will be opening the locker. Hence this locker with 8 divisors will be closed at the end of the process.
It does not matter whether there are 100 or 1000 lockers, the results would be the same. All perfect square
numbered lockers will end up being open while all the others will be closed at the end of the process.
My process was quite efficient, and the pattern was noticed almost right away. When approaching a problem
such as this one, I think it is best to make an organized chart or table to find a pattern.