Problem 18 · 2017 Math Kangaroo
Hard
Number Theory
digit-sumdivisibility
Two consecutive positive whole numbers are written on a board. The sum of the digits of each number is divisible by 7. What is the minimum number of digits the smaller of the two numbers has to have?
Show answer
Answer: C — 5
Show hints
Hint 1 of 2
Normally adding 1 raises the digit sum by 1, so both sums can be multiples of 7 only when carrying happens.
Still stuck? Show hint 2 →
Hint 2 of 2
Trailing 9s cause big drops in the digit sum; figure out how many 9s are needed for both sums to stay divisible by 7.
Show solution
Approach: use trailing nines to control how the digit sum changes
- If the smaller number ends in k nines, adding 1 turns them to zeros and bumps the next digit, so the digit sum changes by 1 - 9k.
- For both digit sums divisible by 7 we need 9k = 1 (mod 7), i.e. 2k = 1 (mod 7), giving k = 4 as the smallest.
- Four trailing nines plus at least one leading digit (e.g. 69999) is needed, which has 5 digits.
Mark:
· log in to save