Solution
Palindromes and Seven
Show the problem again
A four-digit palindrome is a number of the form $\overline{abba}$ with $a \neq 0$, such as 1221 or 7007. How many four-digit palindromes are divisible by 7? Give an integer.
Worked solution
The answer is 18. Write $\overline{abba} = 1000a + 100b + 10b + a = 1001a + 110b$. The key fact is $1001 = 7 \times 11 \times 13$, so $1001a$ is always a multiple of 7. Hence $7 \mid \overline{abba}$ iff $7 \mid 110b$, and since $\gcd(110, 7) = 1$, iff $7 \mid b$, i.e. $b \in \{0, 7\}$. With 9 choices of $a$ and 2 of $b$ there are 18 such palindromes. (The same argument shows every four-digit palindrome is divisible by 11.)
Source: Original problem written for AxiomIQ.