7. We say that a natural number is a palindrome if it reads the same from left to right and from right to left.

a) How many five-digit palindromes are divisible by 5?

b) How many five-digit palindromes are divisible by 3?
First method:

a) For a number to be a palindrome and simultaneously divisible by 5, the last digit can only be 5 (it cannot be 0 because the leading digit cannot be 0), and thus the first digit from the left is also 5. 1 POINT

The second digit can be chosen in 10 ways, and the third digit can also be chosen in 10 ways.

1 POINT

Since the number is a palindrome, the fourth digit is uniquely determined.

Therefore, the total number of such numbers is $10 \cdot 10 = 100$.

1 POINT

b) The first digit from the left cannot be 0; the first two digits can be chosen in $9 \cdot 10 = 90$ ways.

1 POINT

The last two digits are then uniquely determined.

We now choose the middle digit so that the number is divisible by 3, i.e., the sum of all digits is divisible by 3.

For the 90 possible choices of the first two digits, exactly 30 are divisible by 3, exactly 30 give a remainder of 1 when divided by 3, and exactly 30 give a remainder of 2 when divided by 3, and the same applies to the sum of their digits.

1 POINT

Therefore:

(i) in 30 cases, the sum of all digits except the middle one is divisible by 3,

(ii) in 30 cases, the sum of all digits except the middle one gives a remainder of 1 when divided by 3,

(iii) in 30 cases, the sum of all digits except the middle one gives a remainder of 2 when divided by 3.

1 POINT

For case (i), for the number to be divisible by 3, the middle digit must be divisible by 3, i.e., it must be 0, 3, 6, or 9, so there are $30 \cdot 4 = 120$ such numbers.

1 POINT

For case (ii), for the number to be divisible by 3, the middle digit must give a remainder of 2 when divided by 3, i.e., it must be 2, 5, or 8, so there are $30 \cdot 3 = 90$ such numbers.

1 POINT

For case (iii), for the number to be divisible by 3, the middle digit must give a remainder of 1 when divided by 3, i.e., it must be 1, 4, or 7, so there are $30 \cdot 3 = 90$ such numbers.

1 POINT

Therefore, the total number of such numbers is $30 \cdot 4 + 30 \cdot 3 + 30 \cdot 3 = 300$.

1 POINT

TOTAL 10 POINTS