AIME 1996 · 第 9 题
AIME 1996 — Problem 9
题目详情
Problem
A bored student walks down a hall that contains a row of closed lockers, numbered to . He opens the locker numbered 1, and then alternates between skipping and opening each locker thereafter. When he reaches the end of the hall, the student turns around and starts back. He opens the first closed locker he encounters, and then alternates between skipping and opening each closed locker thereafter. The student continues wandering back and forth in this manner until every locker is open. What is the number of the last locker he opens?
解析
Solutions
Solution 1
On his first pass, he opens all of the odd lockers. So there are only even lockers closed. Then he opens the lockers that are multiples of , leaving only lockers and . Then he goes ahead and opens all lockers , leaving lockers either or . He then goes ahead and opens all lockers , leaving the lockers either or . He then goes ahead and opens all lockers , leaving or . He then opens , leaving or . He then opens and leaves and . He then opens all , so we have and , leaving lockers , and , and he is at where he started again. He then opens and , and then goes back and opens locker number , leaving locker number untouched. He opens that locker.
~edit made by Yiyj1: the and are the same as .
Solution 2
We can also solve this with recursion. Let be the last locker he opens given that he started with lockers. Let there be lockers. After he first reaches the end of the hallway, there are lockers remaining. There is a correspondence between these unopened lockers and if he began with lockers. The locker (if he started with lockers) corresponds to the locker (if he started with lockers). It follows that as they are corresponding lockers. We can compute and use the recursion to find
Solution 3 (bash)
List all the numbers from through , then do the process yourself!!! It will take about 25 minutes (if you don't start to see the pattern), but that's okay, eventually, you will get .
(Note: If you try to do this, first look through all the problems! -Guy)
Solution 4 (bash but it takes less than 3 minutes)
Note that whenever the student makes a pass starting on one end, the number at the other end of that line will remain. This is very important.
Pass :
Pass :
Pass (reversed, note that we take the second-to-last term of the previous sequence for every new sequence):
Pass :
Pass :
Pass :
Pass :
Pass :
Pass :
Pass :
Pass :
The answer is therefore
~martianrunner
Edit from EthanSpoon, Doing this with only even numbers will make it faster. You'll see. 02496
Edit from Iamaimogoldmedalist. Doing some few rounds in your head till you get Multiples of 4 or possibly numbers of the form 8k+2 will enhance your speed.