2. A palindromic number is a positive integer which reads the same when its digits are reversed, for example 269 962. Find all six-digit palindromic numbers that are divisible by 45 .
SolUTION
Let $P$ represent such a six-digit number.
As $P$ is palindromic it must have the form ' $a b c c b a$ ', where $a, b$ and $c$ are single-digits and $a$ is non-zero (as $P$ must be a six-digit number).

As $P$ is divisible by 45 , it must also be divisible by 5 which means that $a=5$ and so $P$ can be written as ' $5 b c c b 5$ '.
$P$ must be divisible by 9 and so the sum of its digits must also be divisible by 9 . This means that $10+2 b+2 c$ must be a multiple of 9 . Dividing the previous expression by 2 must still yield a multiple of 9 (as 2 and 9 are co-prime), and so $5+b+c$ must be a multiple of nine.
We next focus on the possible values of $b$.
If $b=0$ then $5+0+c$ must be a multiple of 9 and so $c$ must be 4 .
Similarly, we have:
If $b=1$ then $c$ must be 3 .
If $b=2$ then $c$ must be 2 .
If $b=3$ then $c$ must be 1 .
If $b=4$ then $c$ must be 0 or 9 .
If $b=5$ then $c$ must be 8 .
If $b=6$ then $c$ must be 7 .
If $b=7$ then $c$ must be 6 .
If $b=8$ then $c$ must be 5 .
If $b=9$ then $c$ must be 4 .
The possible values of $P$ are 504405, 513315, 522225, 531135, 540045, 549945, 558855, $567765,576675,585585$ and 594495 .