# Prove that $N - M$ $\equiv$ $0$ mod $9$.

We say that a number $N$ is a "rainbow" number if every digit from {$0, 1, .... 9$} shows up exactly once in $N$; for example $1234567890$ and $1029384756$ are both rainbow numbers. Take any two integer rainbow numbers $N$, $M$. Prove that $N - M$ $\equiv$ $0$ mod $9$.

I am trying to use direct prove to find an example of $N$ and $M$ in order to prove this question. Are there any two rainbow numbers that can satisfy above condition? I am kinda stuck here.

• Hint: show that any rainbow number is divisble by 9. – Sean Roberson Aug 14 '18 at 3:08

• A number is divisible by $9$ if the sum of each digit is divisible by $9$.
• Subtraction of two number that is divisible by $m$ is divisible by $m$.