CEMC Banner

Problem of the Week
Problem E and Solution
Wipe Away 3

Problem

Tyra writes consecutive positive integers on a whiteboard starting with the integer \(1\). However, when she writes a number that is a multiple of \(9\), or contains the digit \(9\), Juliana immediately erases it. If they continue this for a long time, what is the 400th number that Juliana will erase?

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 consider the integers between \(1\) and \(999\), inclusive. Since \(999 = 111 \times 9\), there are \(111\) multiples of \(9\) between \(1\) and \(999\).

Now let’s figure out how many of the integers from \(1\) to \(999\) contain the digit \(9\). The integers from \(1\) to \(99\) 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 \(99\) that contain the digit \(9\). Since there are \(19\) integers from \(1\) to \(99\) 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 \(999\), every integer contains the digit \(9\). Thus, there are \(100\) numbers that contain the digit \(9\). Thus, in total, \(171+100 = 271\) of the integers from \(1\) to \(999\) contain the digit \(9\).

However, some of the integers that contain the digit \(9\) are also multiples of \(9\), so were counted twice. 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\) integers from \(1\) to \(999\) that contain the digit \(9\), and are also multiples of \(9\). It follows that Juliana erases \(111+271-31=351\) of the numbers from \(1\) to \(999\) from the whiteboard. Since we are looking for the 400th number that Juliana erases, we need to keep going.

Next, we consider the integers between \(1000\) and \(1099\), inclusive. Since \(1099=(122 \times 9)+1\), there are \(122\) multiples of \(9\) between \(1\) and \(1099\). Since there are \(111\) multiples of \(9\) between \(1\) and \(999\), it follows that there are \(122-111=11\) multiples of \(9\) between \(1000\) and \(1099\). The integers between \(1000\) and \(1099\) that contain the digit \(9\) are \(1009,~1019, \ldots, 1079,~ 1089\) as well as \(1090,~ 1091, \ldots, 1097~ , 1098,~ 1099\). Thus, there are \(19\) integers from \(1000\) to \(1099\) that contain the digit \(9\). Of these, the only integers that are also multiples of \(9\) are \(1089\) and \(1098\). Thus, Juliana erases \(11+19-2=28\) of the numbers from \(1000\) to \(1099\) from the whiteboard. In total, she has now erased \(351+28=379\) numbers.

Next, we consider the integers between \(1100\) and \(1189\), inclusive. Since \(1189=(132 \times 9) +1\), there are \(132\) multiples of \(9\) between \(1\) and \(1189\). Since there are \(122\) multiples of \(9\) between \(1\) and \(1099\), it follows that there are \(132-122=10\) multiples of \(9\) between \(1100\) and \(1189\). The integers between \(1100\) and \(1189\) that contain the digit \(9\) are \(1109,~1119,\dots,1179,~1189\). Thus there are \(9\) integers from \(1100\) to \(1189\) that contain the digit \(9\). The only one of these that is also a multiple of \(9\) is \(1179\). Thus, Juliana erases \(10+9-1=18\) of the numbers from \(1100\) to \(1189\) from the whiteboard. In total, she has now erased \(379+18=397\) numbers.

The next three numbers that Juliana will erase are \(1190,~1191,\) and \(1192\). Thus, the 400th number that Juliana erases is \(1192\).