Monday, 5 September 2016

MORE LOCKERS, AND HOW I KNOW I'M NOT COOL

Oh mercy. I came across as very pretentious yesterday (reading it back). I like a puzzle. I'm tempted to leave it unresolved but I promised an answer.

See, this kind of thing is how I know I'm definitely not cool. Cool people would let it go and not go on about it. The bit of my head that likes knowledge and showing off about it though, sometimes takes over. Encyclopedia-Matt is a bore.

Just to recap then, Emmie set me a puzzle and I stayed up trying to solve it.

If you're interested, here's what I sent her...

--

Thank you for this maths puzzle. Engaged a part of my brain I don't use too often.

Here is why I think there are 31 open lockers:

Each locker is opened a certain number of times. It follows that if a locker is changed an even number of times then it will always finish shut, and if it is changed an odd number of times, it will be open at the end of the puzzle.

So, if you think about it from the lockers' perspective, all you have to do is figure out how many times each one has been changed.

The students are opening/closing the lockers in multiples of numbers. For example, Student 5 changes lockers 5,10,15, etc. Locker 15 has already been changed by Student 5 and Student 3, not to mention Student 1 (who opened them all). In total, locker 15 has been changed by 4 students, which means it finishes the puzzle closed (4 is an even number).

In fact, 1,3,5 and 15 are the factors of the number 15. These are the only whole numbers that multiply together to make 15. This is true for all the lockers: the students who touched a locker represent the factors of that locker number. So, if a locker number has an even number of factors (student interactions) then it finishes the puzzle closed.

As it turns out, most numbers have an even number of factors. After all, it's usually pairs of numbers that multiply together to produce them (6 for example has 4 factors: 6x1 and 3x2 so 1,2,3 and 6).

However there are certain numbers with an odd number of factors. These are numbers where a pair of multiplying factors are identical. For example, 9 has 3 factors: 9x1=9 and 3x3=9 so 1,3 and 9 are the factors of 9. Locker number 9 finishes the puzzle open.

16 also has an odd number of factors: (1,2,4,8 and 16).

These numbers are called square numbers. Square numbers are the only numbers with an odd number of factors. So all the lockers which are square numbers are also the only ones which have been touched an odd number of times and therefore are the only lockers which will finish the puzzle open.

To find out how many there are, all you have to do is find out how many square numbers there are between 1 and 1000, or the largest square number which is lower than the total number of lockers.

In this case, the largest square number is 961 which is 31 x 31. Hence there will be 31 open lockers at the end of the puzzle and 969 which are closed.

No comments:

Post a Comment