Subject 3. A natural number is called alternant if it has 2014 digits and any two adjacent digits have different parities. What is the smallest alternant number that is divisible by 9? What is the largest?
## Subject 3.

|  | The sum of the digits of the sought numbers must be divisible by 9. | 1p |
| :--- | :--- | :--- |
|  | The smallest alternating number must start with 1. It is followed by the smallest possible even digit, 0, the smallest odd digit, 1, the smallest even digit, 0, and so on, the 2012th digit can be chosen as 0. If we choose the second-to-last digit to be 1, the sum of the chosen digits so far is 1007. We cannot choose any even digit such that the sum of the digits of the formed number is divisible by 9. We will then choose the second-to-last digit as 3. We can then choose the last digit as 8, and the formed number is 1010...1038. | **3p** |
|  | The largest alternating number that is a multiple of 9 will start with 9898...98 - 2012 digits. The sum of the chosen digits up to this point is (9+8)·1006 = 17·1006 = 17010. We cannot choose the second-to-last digit to be 9 (we will not find any even digit for which the formed number is divisible by 9), so we choose 7 and can take the last digit as 0. The resulting number is 989898...9870. | 3p |