Consider the following operation. Given a positive integer , if is a multiple of , then you replace by . If is not a multiple of , then you replace by . For example, beginning with , this procedure gives . Suppose you start with . What value results if you perform this operation exactly times?
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
Work out the first ten or so steps. From step 6 the values repeat 20, 30, 10, so step 100 matches step 7, which is 30.
Solution
Doing steps by hand is too many, but the numbers might start repeating. So do the first few steps and watch.
- Start at . It is not a multiple of , so add : . Keep going:
| step | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| value | 110 | 120 | 40 | 50 | 60 | 20 | 30 | 10 | 20 | 30 | 10 |
(For example, is a multiple of , so it becomes ; becomes ; becomes ; is not a multiple of , so it becomes .)
2. At step we are back at , the value from step . From then on the same three numbers repeat forever:
3. Match each step with its value:
- steps (multiples of ) give ,
- steps (one more than a multiple of ) give ,
- steps (two more than a multiple of ) give .
4. , and . So is one more than a multiple of , just like step . The value is .
The answer is .
Why this works
A rule that always does the same thing to the same number must start repeating as soon as a number comes back. Work out steps until you see a repeat, note how long the repeating block is, and then use division to find where the target step lands in the block. Line it up using a step you have actually computed, so you do not end up one step off.
The trap
Lining the repeating pattern up with the wrong step. Step 6 is 20, so steps 7, 10, 13, and so on (one more than a multiple of 3) are 30.
Concise solution
Apply the rule and record the result after each step:
| step | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| value | 110 | 120 | 40 | 50 | 60 | 20 | 30 | 10 | 20 | 30 | 10 |
From step on the values repeat with period : step (multiples of ) give ; steps give ; steps give .
Since is one more than a multiple of (like step ), the value after operations is .
The answer is .
Review in the AoPS books
- Introduction to Algebra, Chapter 21: Sequences & Series (§21.1, §21.2, §21.3, §21.4)
- Introduction to Number Theory, Chapter 12: Introduction to Modular Arithmetic
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.1)
- Intermediate Algebra, Chapter 17: More Sequences and Series (§17.1, §17.2)
Techniques
Compute small cases, spot the pattern, generalize