# a question about permutation in the digits in the decimal system

This is an exercise from a textbook in Portuguese.

Choose a symbol (number) $abc$ in the decimal system ($a$ being the hundreds digit, $b$ the tens digit, and $c$ the units digit), in a way that the hundreds digit $a$ and the units digit $c$ differ by at least $2$ units. Consider the numbers $abc$ and $cba$ and subtract the smaller from the bigger in order to get a number $xyz$. Show that the sum of $xyz$ with $zyx$ is 1089.

I know that $abc=a10^{2}+b10+c$, $cba=c10^{2}+b10+a$, and $c=a+i$, $i\geq 2$ (or $a=c+i$, $i\geq 2$). So if $c=a+i$, $i\geq 2$, then $$cba=(a+i)10^{2}+b10+(c-i)=a10^{2}+b10+c+(i10^{2}-i)=a10^{2}+b10+c+(99i)\;.$$ So $xyz=cba-abc=99i$, or $9 \mid xyz$ wich give me that $x+y+z=9k$, and $11 \mid xyz$ wich give me a condition, but I still can use this.

I would appreciate your help! Sorry for the lousy title.

-
See also my answer here, which proves it using grade-school arithmetic. – Bill Dubuque Sep 5 '12 at 20:24

You're almost there. $xyz = 99i = 100i - i$ which has digits $x = i-1$, $y = 9$, $z = 10-i$ and so $$xyz + zyx = 100(i-1) + 90 + (10-i) + 100(10-i) + 90 + (i-1)$$$$= 100(9) + 90 + 90 + 9 = 1089.$$

-

Assume without loss of generality that $c=a+i$, where $i\ge2$. Then

$$cba-abc=\Big(100(a+i)+10b+a\Big)-\Big(100a+10b+a+i\Big)=100i-i=99i\;.$$

Now $2\le i\le 9$, so $99i\in\{198,297,396,495,594,693,792,891\}$. Note that the reversal of $99i$ is $99(11-i)$ for $i=2,\dots,8$, so $xyz+zyx=99i+99(11-i)=99\cdot11=1089$.

-

Wlog $a>c$ (i.e. $abc>cba$), Then $c-a$ will need a borrow, which causes in the second column $b-b-\mathrm{borrow}$ also needing a borrow, therefore with $abc-cba = xyz$ we have $x=(a-c-1)$, $y=9$ and $z=(10+c-a)$. The condition of $\lvert a-c\rvert>1$ ensures that $x\neq0$. Now $xyz+zyx = 101(x+z)+10\cdot 2y = 101(a-c-1+10+c-a)+10\cdot 18=101\cdot9+180=1089$.

-