Skip to main content
OlympiadHQ

Browse · MATH

Print

jmc

number theory senior

Problem

Let be the number obtained by writing the integers 1 to from left to right. Therefore, and For , how many are divisible by 9?
Solution
Let be the sum of the digits of . It turns out that is always divisible by 9. As a proof, write . Therefore, . Note that, in general, is divisible by 9 because is actually a string of 9's. Therefore, we can factor a 9 out of the right-hand side, so is always divisible by 9. Note furthermore that is always nonnegative, and that and share the same remainder when divided by 9 (these are corollaries, the first coming from observation, the second being a direct result of the proof).

Now, consider , which is divisible by 9 if and only if is. We have . Since and have the same remainder when divided by 9, so we can substitute for in each term without changing the remainder when divided by 9. Therefore, , which implies that we need either or to be divisible by 9. This happens either when is a multiple of 9 or when is one less than a multiple of 9. There are 11 multiples of 9 less than or equal to 100, and since 100 is not a multiple of 9, there are also 11 numbers which are one less than a multiple of 9 between 1 and 100. Therefore, there are values of that are divisible by 9 for .
Final answer
22