How many 5-digit palindromes are divisible by 9? What I already have,

*

*Palindrome in form XYZYX, where X can’t be 0.

*Divisibility rule of 9: sum of digits is divisible by 9. So, we have 2(X+Y)+Z = 9M.

*The first part is divisible by 9 if and only if X+Y is divisible by 9. So, we have 10 pairs out of 90. And each such pair the total sum is divisible by 9 when Z is also divisible by 9. There are 2 such Zs: 0, 9. So, there are 20 divisible palindromes.

*If (X+Y) mod 9 = 1, then 2(X+Y) mod 9 = 2; and in order for the total sum to be divisible by 8, Z must have the remainder of 1 when divided by 9. There is 1 such Z: 1. And again, we have 10 xy pairs with the given remainder. So, this case yields 10*1 = 30 more palindromes.

*Same logic as on previous step applies to the case when 2(X+Y) mod 9 = 2.

*So, total number of divisible palindromes = 80?

When using this method, I only get 80 numbers of 5-digit palindromes that are divisible by 9(?) i dont think im doing this method correctly, can someone show me whats going on here
 A: As you have rightly mentioned, we need to figure out all tuples of $(X,Y,Z)$ such that $$2(X+Y)+Z\bmod 9 = 0 \implies 2(X+Y)\bmod 9 = (9-Z)\bmod 9.\tag{1}$$
Note that for any value of $2(X+Y)\bmod 9=0,1,\ldots,8$, the corresponding value of $(X+Y)\bmod 9$ is unique. Also, for any given $k=0,1,\ldots,8$, the tuples that satisfy $(X+Y)\bmod 9=k$ are given by
$$(k, 9) \text{ and } (X,k-X\bmod 9) \text{ for } X=1,2,\ldots,9.$$ So, there are $10$ tuples $(X,Y)$ corresponding to any given value of $2(X+Y)\bmod 9$.
Further, for any given value of $2(X+Y)\bmod 9$ in $(1)$, the corresponding value of $Z$ is also unique except when $2(X+Y)\bmod 9 = 0$. When $2(X+Y)\bmod 9 = 0$, $Z$ can either be $0$ or $9$. Consequently, with $2(X+Y)\bmod 9=1,2,\ldots,8$, there are $80$ palindromes divisible by $9$, and with $2(X+Y)\bmod 9=0$, there are $20$ palindromes divisible by $9$.
Hence, the total number of $5-$digit palindromes divisible by $9$ is $100$.
A: Choose digits $Y$ and $Z$ freely ($100$ ways to do this). Then there is a unique nonzero digit $X$ so that $2X+2Y+Z\equiv 0 \pmod{9}$.
A: The answer is $100$, my argument is as follows.
$X$ is choosen as a digit from $1$ to $9$, and $Y$ from $0$ to $9$,
now you want that $9|(2(X+Y)+Z)$.
Two cases:
(1) if $9|2(X+Y)$, then $2(X+Y)=9k$ for some natural number $k>0$, and since $Z$ is an integer from $0$ to $9$ you would have that both $Z=0,9$ work.
(2) if $9\not|2(X+Y)$, then you would have that there exists $k$ natural number such that $9(k-1)<2(X+Y)<9k$ and still becouse $0\le Z\le 9$ you obtain this time that there exists only one value of $Z$ that satisfies the problem, and it is $9k-2(X+Y)$.
So we want to find when $9|2(X+Y) \Rightarrow 9|(X+Y)$: so if $1\le X\le8$, then $Y=9-X$; if $X=9$, then $Y=0,9$ work. So $10$ cases where (1) happens
To conclude: there are $9\cdot 10=90$ possibilities between $X,Y$ of which $10$ cases are (1) and $80$ are (2), so the final number is $10\cdot 2 + 80\cdot 1=100$
A: The numbers are $abcba$ with $1\le a\le9$ and $0\le b,c\le9$ and $2(a+b)+c=9,18,27,36,45$.
$c=0$ gives $2(a+b)=18,36\Rightarrow a+b=9,18$ which gives $ab=18,27,36,45,90,99$ then $10$ examples.
$c=1$ gives $a+b=4,13$ which gives $ab=13,22,40,49,58,67$ then $10$ examples.
$c=2$ gives $a+b=8,17$ which gives $ab=17,26,35,44,80,89$ then $10$ examples.
We can verify that the seven other central values $c$ give also $10$ examples each of them.
Consequently there are 100 examples.
