Ximena wishes to number the pages of a notebook. For this, she has a large quantity of stickers with the digits $0,1,3,4,5,6,7,8$ and 9, but she has only 100 stickers with the digit 2. Determine up to which page Ximena can number this notebook.

#
Solution

Let's start by counting how many times the digit 2 appears in the numbers from 1 to 199. As the units digit, the digit 2 appears on the pages

$$
2,12,22,32,42,52,62, \ldots, 152,162,172,182,192
$$

so far, we have counted 20 numbers.

As the tens digit, the digit 2 appears on the pages

$$
20,21,22,23, \ldots, 28,29,120,121,122,123, \ldots, 128,129
$$

If we erase the digit 2 from the tens place of these numbers, we get the numbers from 0 to 19. Thus, we count 20 more numbers. Up to this point, we have seen that the digit 2 is used 40 times in the first 199 pages.

From page 200 to page 219, we use the digit 2 20 times in the hundreds place and 2 times in the units place in the numbers 202 and 212. This adds up to 22 times.

In the 10 pages from 220 to 229, we use the digit 2 ten times in the hundreds place, ten times in the tens place, and once in the units place, totaling $10+10+1=21$ times.

Up to page 229, we have used the digit 2 a total of $40+22+21=83$ times. There are still 17 stickers with the digit 2 left. For the 10 pages from 230 to 239, 10 stickers are used for the hundreds place and 1 for the units place. Now, 6 stickers remain, which can be used on the pages

$$
240, \quad 241, \quad 242, \quad 243 \text { and } 244
$$

Thus, we conclude that Ximena can only number the pages up to page 244.