CEMC Banner

Problem of the Week
Problem D and Solution
Wipe Away 2

Problem

Ajay writes the positive integers from \(1\) to \(1000\) on a whiteboard. Jamilah then erases all the numbers that are multiples of \(9\). Magdalena then erases all the remaining numbers that contain the digit \(9\). How many numbers are left on the whiteboard?

Note: In solving this problem, it may be helpful to use the fact that a number is divisible by \(9\) exactly when the sum of its digits is divisible by \(9\). For example, the number \(214\,578\) is divisible by \(9\) since \(2+1+4+5+7+8 = 27\), which is divisible by \(9\). In fact, \(214\,578=9 \times 23\,842.\)

Solution

We first calculate the number of integers that Jamilah erases, which is the number of multiples of \(9\) between \(1\) and \(1000\). Since \(1000 = (111 \times 9) + 1\), there are \(111\) multiples of \(9\) between \(1\) and \(1000\). Thus, Jamilah erases \(111\) numbers from the whiteboard.

Now let’s figure out how many of the integers from \(1\) to \(1000\) contain the digit \(9\). The integers from \(1\) to \(100\) that contain the digit \(9\) are \(9,19, \ldots, 79, 89\) as well as \(90, 91, \ldots, 97 , 98, 99\). Thus, there are \(19\) positive integers from \(1\) to \(100\) that contain the digit \(9\). Since there are \(19\) integers from \(1\) to \(100\) that contain the digit \(9\), it follows that there are \(19 \times 9 = 171\) integers from \(1\) to \(899\) that contain the digit \(9\).

Between \(900\) and \(1000\), there are \(100\) integers that contain the digit \(9\), namely, every number except for \(1000\). Thus, in total, \(171+100 = 271\) of the integers from \(1\) to \(1000\) contain the digit \(9\).

However, some of the integers that contain the digit \(9\) are also multiples of \(9\), so were erased by Jamilah. To determine how many of these such numbers there are, we use the fact that a number is divisible by \(9\) exactly when the sum of its digits is divisible by \(9\).

Thus, there are \(1+2+28=31\) numbers that contain the digit \(9\), but were erased by Jamilah. It follows that Magdalena erases \(271-31=240\) numbers from the whiteboard.

Hence, the number of numbers left on the whiteboard is \(1000 - 111 - 240 = 649\).