A certain hallway contains a row of lockers numbered from 1 to 30.

  • Thread starter snipez90
  • Start date
  • Tags
    Row
In summary, after all 30 students finish their walks, the number of lockers remaining closed can be found by finding the number of perfect squares less than or equal to 30. Thus, there are 5 lockers remaining closed.
  • #1
snipez90
1,101
5
A certain hallway contains a row of lockers numbered from 1 to 30. All the lockers are initially closed. 30 students are lined up in the hallway. The first student walks down the row and opens up all the lockers. The second student closes all the lockers numbered 2, 4, 6, ..., 30. The third student performs an operation on the lockers numbered 3, 6, 9, ..., 30; if a locker was open, he closes it and if a locker was closed, he opens it. For the n-th student, he operates on the lockers numbered by multiples of n; if a locker was open, he closes it and if a locker was closed, he opens it. How many lockers remain closed after all 30 students finish their walks?
 
Physics news on Phys.org
  • #2


Answer:
24
Proof: (sorry, I don't know how to hide the proof)

Code:
oooooooooooooooooooooooooooooo
 c c c c c c c c c c c c c c c
  c  o  c  o  c  o  c  o  c  o
   o   o   c   o   o   c   o
    c    o    o    c    c    c
     c     o     c     o     o
      c      o      o      c
       c       c       c
        o        o        o
         c         o         c
          c          o
           c           o
            c            o
             c             o
              c              o
               o
                c
                 c
                  c
                   c
                    c
                     c
                      c
                       o
                        o
                         c
                          c
                           c
                            c
                             c
 
  • #3


25.

Door number n will be closed if n has an even number of divisors, and open if n has an odd number of divisors. The divisor function phi0(n) is odd iff n is a perfect square. Since there are five perfect squares between 1 and 30, there will be five open doors when all students finish their tasks. The other 25 doors will be closed.
 
Last edited:
  • #4


When I first saw this problem it was asked with 1000 lockers, it still really easy to figure out with that number, but initially it makes it sound harder.
 

Related to A certain hallway contains a row of lockers numbered from 1 to 30.

1. How many lockers are in the hallway?

There are 30 lockers in the hallway, numbered from 1 to 30.

2. Are all the lockers being used?

It is not specified whether all the lockers are being used or not. Some may be empty while others may be in use.

3. Can the lockers be opened by anyone?

It is not specified who has access to the lockers. It is possible that only certain individuals have keys to open them.

4. Are the lockers evenly spaced throughout the hallway?

It is not specified how the lockers are spaced throughout the hallway. They may be evenly spaced or grouped together in a certain area.

5. Can the numbers on the lockers be changed?

The numbers on the lockers are fixed and cannot be changed unless physically altered or replaced.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
16
Views
12K
Replies
20
Views
8K
  • General Math
Replies
1
Views
3K
Replies
11
Views
3K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
4K
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • General Discussion
Replies
12
Views
3K
  • Precalculus Mathematics Homework Help
Replies
8
Views
441
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
Back
Top