# Difference between two integers

I need help with the following problem:

(1) The positive difference between a two digit integer and the integer created when the two digits are reversed is $27$. What is the positive difference of these two digits?

(2) The positive difference between a three digit integer and the integer created when the three digits are reversed in order is $297$. What is the positive difference of the hundreds digit and the units digit?

(3) The positive difference between a $4$ digit integer and the integer created when the thousands digit and the units digit are exchanged is $5994$. What is the positive difference of the thousands digit and the units digit? (You should begin to see a pattern here!)

My Attempt I tried setting variables equal to the tens place, units place, etc. But I keep on getting a Diophantine equation. Is that supposed to happen?

Start with the two-digit case: $$\overline{ab}\to\overline{ba}$$ $$10a+b-10b-a=27$$ $$9(a-b)=27$$ $$a-b=3$$ So the required digit difference is 3. Now move on to the three-digit case: $$\overline{abc}\to\overline{cba}$$ $$100a+10b+c-100c-10b-a=297$$ $$99(a-c)=297$$ $$a-c=3$$ The digit difference is still 3. Similarly, for the four-digit case (I'll leave the working out since you're supposed to see the pattern), the digit difference is $\frac{5994}{999}=6$.
• Yes, I realized my problem. I, blindly, wrote $10(a-b)+b-a=27$ And did not see the possible factorization if I had written $-(a-b)$. – Frank Oct 2 '16 at 16:29
(1) We are given $(10a+b)-(10b+a)=27$. The left hand side is $9(a-b)$, hence $a-b=3$.