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
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$.