Skip to main content
OlympiadHQ

Browse · MathNet

Print

HongKong 2022-23 IMO Selection Tests

Hong Kong 2022 counting and probability

Problem

Someone obtained a positive integer by concatenating the positive integers from 1 to 100000 in order, i.e. . How many times does '2022' appears as consecutive digits of ?
Solution
For clearer illustration, we add a comma between two integers as we form by concatenating the integers from to , i.e. we write

We count the number of occurrences of according to the positions of the commas within these digits.

Case 1: 2022 (i.e. no comma within the digits) The first occurs either as a ten thousands digit or as a thousands digit. Each occurs times, giving occurrences in this case: - , , , , , , , , , ; - , , ; , , ; ; , , .

Case 2: 202, 2 The first part may come from the three digit number , the four digit number , or a five-digit number starting with (there are such numbers), giving occurrences in this case: - , ; - , ; - , ; , ; ; , .

* Case 3: 20, 22 The first part may come from the three-digit number , four-digit number , or a five-digit number starting with (there are such numbers), giving occurrences in this case: - , ; - , ; - , , , ; ; , .

It follows that the answer is .
Final answer
44

Techniques

Other