3. Let's call a natural number an almost palindrome if it can be transformed into a palindrome by changing one of its digits. How many nine-digit almost palindromes exist? (20 points)
Solution: After replacing one digit in the almost palindrome, we get a number of the form $\overline{a b c d e d c b a}$. Let's divide the digits into pairs by place value: 1 and 9, 2 and 8, 3 and 7, 4 and 6. In any almost palindrome, the digits in three of the specified pairs of place values must be the same, and in exactly one pair they must be different.

International School Olympiad URFU "Emerald" 2022, 2nd stage

We can turn this number into a palindrome by replacing one of the two digits in the remaining pair with the other digit in that pair. We can choose three pairs of place values in 4 ways (3 of them include the pair 1 and 9, and exactly one way does not include this pair), in each pair (except for 1 and 9) the digits can be any and the same, in the pair 1 and 9 (if it is chosen) the digits are the same and not equal to zero, in the remaining pair the digits are different (any, if it is not the pair 1 and 9, and any except zero in the first place, if the pair 1 and 9 remains), and the middle digit is arbitrary. The total number of such numbers is

$$
3 \cdot 10^{3} \cdot 9 \cdot 10 \cdot 9+10^{4} \cdot 9 \cdot 9=3240000
$$

Answer: 3240000