Think of locker 1... it gets opened and never touched, so it is OPEN
Think of locker 2... it gets opened and closed, then never touched, it is closed.
Think of locker 3... it gets touched twice (1 and 3) so it is closed.
Locker 4... touched on 1, 2 and 4 so it is OPEN
Locker 5 = 1, 5 --> closed
Locker 6 = 1, 2, 3, 6 --> closed
Locker 7 = 1, 7 --> closed
Locker 8 = 1, 2, 4, 8 --> closed
Locker 9 = 1, 3, 9 --> OPEN
Notice a pattern? The open lockers so far are 1, 4, 9, ...
In general, if you have locker n, it is touched for each factor that it has. Most numbers have pairs of factors, so they have an even number. That means they will be open and closed an even number of times.
The exception are the perfect squares... they have an odd number of factors, because one of those factors "pairs up" with itself. That means they will end up OPEN.
Every locker that is a perfect square is open, and all the others are closed.
1, 4, 9, 16, 25, 36 ... 900, 961 are opened. That's 1², 2², 3² ... 30², 31². 31 squares = 31 open lockers.
So you have 31 open lockers and 969 closed lockers.
2006-12-12 17:01:30
·
answer #1
·
answered by Puzzling 7
·
2⤊
0⤋
If x is prime it will be opened and closed twice (1 and itself)
If x is the product of 2 distinct primes p and q it will be opened and closed 4 times (1, p, q, pq = x)
Similarly, if x is the product of n distinct primes it will be opened and closed 2^n times (since each factor can be included or not, there are 2^n ways of doing this). This is divisible by 2, so these are all closed.
If x is p^2 then it has factors 1, p, p^2, so it is open. If it is the product of 2 primes squared then it has factors 1, p, p^2, q, pq, p^2q, q^2, pq^2, p^2q^2, 9 factors, so it is open.
If it is a prime squared with another prime = p^2q it has factors 1, q, p, pq, p^2, p^2q, so it is closed.
Putting these together the only things that are flipped an odd number are squares, so open is the number of squares < 1000: 1...31 (32^2 = 1024) You asked closed, this would be 1000 - 31 = 969.
I think.
2006-12-13 01:13:42
·
answer #2
·
answered by sofarsogood 5
·
0⤊
0⤋