Let denote the smallest positive integer that is divisible by both and and whose base- representation consists of only 's and 's, with at least one of each. What are the last four digits of
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
A multiple of 4 must end in 44; a multiple of 9 needs the number of 4's to be a multiple of 9. Use nine 4's and one 9.
Solution
Use the two divisibility tests one at a time, then make the number as small as possible.
Step 1: divisible by 4. A number is a multiple of exactly when its last two digits are. The possible endings are . Only is a multiple of . So ends in .
Step 2: divisible by 9. A number is a multiple of exactly when its digit sum is.
- Each adds to the digit sum, which never changes whether the sum is a multiple of .
- Each adds . With one the sum from the 's is , with two it is , and so on. That sum is a multiple of only when the number of 's is a multiple of .
- There is at least one , so there are at least nine 's.
Step 3: make it small.
1. We need at least nine 's and at least one , so at least digits. Any -digit number is smaller than any longer one, so use exactly nine 's and one .
2. Among these, the smaller number has its farther to the right. The last two digits must be , so the goes third from the right:
3. Check: it ends in , and its digit sum is .
The last four digits are .
The answer is .
Why this works
Tests for and look at digits, so they turn into rules about the ending and about how many of each digit you use. To make a number as small as possible, first use as few digits as possible, then push the larger digits as far to the right as the rules allow.
The trap
Trying numbers with fewer than ten digits, or letting the number end in 9 or 94 (of 44, 49, 94 and 99, only 44 is a multiple of 4).
Concise solution
Divisibility by is decided by the last two digits. Of the endings , only is a multiple of , so ends in .
Divisibility by is decided by the digit sum. Each contributes , which is already a multiple of , so the digit sum is a multiple of exactly when is, that is, when the number of 's is a multiple of . There must be at least one , hence at least nine 's.
Now minimize. The number must have at least one and at least nine 's, so at least digits, and a -digit number beats any longer one. Among -digit numbers with nine 's and one , the smallest puts the as far right as possible; since the last two digits must be , the goes in the third position from the right:
This is divisible by (ends in ) and by (digit sum ).
Its last four digits are .
The answer is .
Review in the AoPS books
- Introduction to Number Theory, Chapter 8: Base Numbers
- Introduction to Number Theory, Chapter 1: Integers: The Basics (§1.4, §1.5)
- Introduction to Number Theory, Chapter 9: Base Number Arithmetic
- Introduction to Number Theory, Chapter 5: Divisor Problems (§5.2, §5.3)
Techniques
Set up the equation/formula and compute; no special trick needed · Consider the largest/smallest element or boundary case