Jim starts with a positive integer and creates a sequence of numbers. Each successive number is obtained by subtracting the largest possible integer square less than or equal to the current number until zero is reached. For example, if Jim starts with , then his sequence contains numbers:
Let be the smallest number for which Jim’s sequence has numbers. What is the units digit of ?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
Work backwards. If m squared is the largest square below n, the leftover is at most 2m, so each smallest start is the previous one plus the smallest allowed square.
Solution
A sequence with numbers takes subtractions to reach . So we want the smallest number that needs steps. Build the answer up from small cases.
Step 1: small cases by hand. Write "steps" for the number of subtractions.
| Start | Sequence | Steps |
|---|---|---|
(Numbers , , go to , , in one step, so they need at most steps. So is the smallest needing .)
Step 2: how big can the leftover be? Suppose the largest square not above is , and the leftover is . The next square, , is bigger than . So
For example, with the leftover can be at most (the numbers to ).
Step 3: the rule for going one step deeper. To need one more step than some number , the first subtraction must leave a number that needs as many steps as . The smallest such start is: leftover exactly (the smallest leftover that works), plus the smallest square that is allowed, which needs .
- 5 steps: leftover needs , so . Start .
- 6 steps: leftover needs , so . Start .
- 7 steps: leftover needs , so . Start .
Step 4: why nothing smaller works. A start with steps must leave, after one subtraction, a number that needs steps, so that leftover is at least . Then forces , and the start is at least . The same reasoning checks each earlier row.
Step 5: check the sequence. is more than , so really is the largest square. The sequence is
which has numbers.
So , and its units digit is .
The answer is .
Why this works
To find the smallest number that takes many steps, work backwards: the number after the first step must itself be the smallest one that takes one step fewer. The only limit is that the leftover can be at most twice , where is the square you subtract, which is why each answer is roughly the square of half the previous one.
The trap
Choosing a square too small for the leftover (then it is not the largest square), or forgetting that 8 numbers means only 7 subtractions.
Concise solution
Let be the number of subtractions needed to reach ; the sequence then has numbers, so we want the smallest with . Let denote the smallest with .
Write where is the largest square not exceeding ; then (otherwise ), and the first step sends to , so .
For we need , hence , and then forces . So . This bound is attained: with and , the number really has as its largest square, and it needs exactly steps. Therefore
Starting from :
(Check: , so is indeed the largest square, and is steps.)
So , whose units digit is .
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 1: Integers: The Basics
- Introduction to Algebra, Chapter 21: Sequences & Series (§21.1, §21.2, §21.3, §21.4)
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.4)
- Introduction to Algebra, Chapter 20: Special Functions (§20.3)
Techniques
Consider the largest/smallest element or boundary case · Start from the end state / desired conclusion and reverse