$1287a 45b$ is a 8-Digit number, where $a$ and $b$ are not zero. The number is divisible by 18. What is the maximum possible difference between $a$ and $b$?
My solution: I first said since it's divisible by 18, it's also divisible by 9 and 2, and since its divisible by 9, the sum of its digits is divisible by 9 so $$a + 27 + b $$ is divisible by 9. Now how do I carry on?
You have done most it. Also, $b$ is even, and $9 | a+b$. And we need to maximize $a-b$ therefore, taking the largest possible $a$ and minimum possible $b$, we get $7-2 = \boxed{5}$ as $a,b \not=0$.