5. A palindrome is a positive integer that is the same when read forwards or backwards. For example, 1331 is a palindrome. Determine the number of palindromes between 1000 and 10000 that are multiples of 6 .
5. Since 1000 and 10000 are not palindromes, then every palindrome between 1000 and 10000 has four digits and so has the form $A B B A$ for some digits $A$ and $B$ with $A \neq 0$.
We are looking for palindromes $A B B A$ that are divisible by 6 .
An integer is divisible by 6 whenever it is divisible by 2 (that is, it is even) and divisible by 3 .
Since we want $A B B A$ to be even, then $A$ must be even.
Therefore, $A=2, A=4, A=6$, or $A=8$.
For a positive integer to be divisible by 3 , the sum of its digits must be divisible by 3 .
We look at each possible value for $A$ separately and determine values of $B$ that give palindromes that are divisible by 6 :
- Case 1: $A=2$
Here, $A B B A=2 B B 2$ and the sum of its digits is $2+B+B+2=2 B+4$.
We need to determine all digits $B$ for which $2 B+4$ is divisible by 3 .
Since $B$ is at most 9 , then $2 B+4$ is at most $2(9)+4=22$. Also, $2 B+4$ is even because $2 B+4=2(B+2)$.
Thus, $2 B+4$ must be an even multiple of 3 that is at most 22 .
Therefore, $2 B+4$ could equal 6,12 or 18 .
If $2 B+4=6$, then $2 B=2$ or $B=1$.
If $2 B+4=12$, then $2 B=8$ or $B=4$.
If $2 B+4=18$, then $2 B=14$ or $B=7$.
(Alternatively, we could have checked each of the values of $B$ from 0 to 9 individually by dividing $2 B B 2$ by 6 .)
- Case 2: $A=4$
Here, $A B B A=4 B B 4$.
Using a similar method to that in Case 1, we determine that the values of $B$ for which $4 B B 4$ is divisible by 6 are $B=2,5,8$.
- Case 3: $A=6$
Here, $A B B A=6 B B 6$.
Using a similar method to that in Case 1, we determine that the values of $B$ for which $6 B B 6$ is divisible by 6 are $B=0,3,6,9$.
- Case 4: $A=8$
Here, $A B B A=8 B B 8$.
Using a similar method to that in Case 1, we determine that the values of $B$ for which $8 B B 8$ is divisible by 6 are $B=1,4,7$.
Therefore, there are $3+3+4+3=13$ palindromes between 1000 and 10000 that are multiples of 6 .
ANSWER: 13