<s>[INST] How many such three digit numbers are possible? Certain $3$-digit numbers have the following characteristics:


*

*all three digits are different

*the number is divisible by $7$

*the number on reversing the digits is also divisible by $7$
How many such numbers are there? I have tried using a brute force approach and found $168$ and $259$. Is there a better way to solve these questions?
 [/INST] If the number is $10^2a+10b+c$ as digits then considering $(10^2a+10b+c) - (10^2c+10b+a)$ leads to realising $99(a-c)$ must be divisible by $7$ and cannot be zero and, since $99$ is coprime to $7$.


*

*$1b8$ but $108 \equiv 3 \pmod 7$ requiring $10b \equiv 4 \pmod 7$ making the only possible value of $b=6$, which is neither $1$ nor $8$ $\checkmark$  

*$2b9$ but $209 \equiv 6 \pmod 7$ requiring $10b \equiv 1 \pmod 7$ making the only possible value of $b=5$, which is neither $2$ nor $9$ $\checkmark$  

*$7b0$ but $700 \equiv 0 \pmod 7$ requiring $10b \equiv 0 \pmod 7$ making the only possible values of $b=0$ or $7$, which are either $7$ or $0$ $\times$ 

*$8b1$ but $801 \equiv 3 \pmod 7$ requiring $10b \equiv 4 \pmod 7$ making the only possible value of $b=6$, which is neither $8$ nor $1$ $\checkmark$   

*$9b2$ but $902 \equiv 6 \pmod 7$ requiring $10b \equiv 1 \pmod 7$ making the only possible value of $b=5$, which is neither $9$ nor $2$ $\checkmark$  


So the possible solutions are $168, 259, 861, 952$
</s>