# 1089 and a Property of 3-digit Numbers

Number 1089 is a centerpiece of a curious mathematical trick used to stun the uninitiated with the performer's math prowess. I was reminded about it watching David Acheson's video. David is the author of highly recommended book 1089 and all that.

Take any 3-digit number, say, 732 and write it backwards: 237. Subtract the smaller of the two numbers (237 in our case) from the larger (732). With our selection, we obtain the number 495. Write this one backwards too and compute the sum:

I am going to explain shortly why this is so, but first either give it a thought or experiment with the applet below. The blue numbers are clickable. The digits increase if clicked to the right of their vertical axis, and decrease if clicked to the left of the axis.

What if applet does not run? |

Let's formulate what we've been doing - an algorithm of sorts:

For any integer A, let A' be obtained by writing A backwards. Compute

The algorithm as described conveys a general idea but, if you played with the applet, you may have noticed that the description begs for additional details. The point is that the applet (and the problem I wish to consider) deal with integers of a fixed length. Subtraction *string* 087.

So the number of digits plays an important role in the procedure. To see what is going on I shall consider the integers with the specified number of digits, starting with the 1-digit numbers.

For a 1-digit A, A' = A so that B = 0 as is B' and their sum.

Now, for a 2-digit numbers A = 10a + b

B = 10(a - b) + (b - a) = 10(a - b - 1) + (10 + b - a).

This modification is necessary because b - a is negative. The new form of B has the advantage that

0 ≤ a - b - 1 ≤ 9 and

0 ≤ 10 + b - a ≤ 9.

It follows that 10(a - b - 1) + (10 + b - a) is the decimal representation of B, so that

B + B' | = 10(a - b - 1) + (10 + b - a) + 10(10 + b - a) + (a - b - 1) | |

= 10·9 + 9 = 99, |

because 10 + b - a + a - b - 1 = 9.

We see that, unless number A is palindromic, that is, read the same way either way, which happens when

For a 3-digit decimal number A = 100a + 10b + c,

B = (100a + 10b + c) - (100c + 10b + a) = 100(a - c) + (c - a).

As with the case of 2-digit numbers, a - c is a decimal digit, while c - a is negative. We apply a similar trick:

B = 100(a - c) + (c - a) = 100(a - c - 1) + 90 + (10 + c - a),

which shows that B always has 9 as the second digit while its other digits add up to 9:

(a - c - 1) + (10 + c - a) = 9.

Writing B as x9y, with x + y = 9, B' = y9x, and

B + B' | = 100(x + y) + 90 + 90 + (x + y) | |

= 900 + 180 + 9 | ||

= 1089, |

proving the magic property of the number 1089.

Every step of the derivation could be repeated in positional systems with bases other than 10. If v and u denote the largest and the penultimate digits in some base, then, for 3-digit numbers, with the exception of palindromes, the algorithm leads to 10uv. For example, in base 36 the algorithm always ends with 10YZ.

### References

- D. Acheson,
*1089 and All That: A Journey into Mathematics*, Oxford University Press, 2010

- 1089 and a Property of 3-digit Numbers
- Four Digits Magic Prediction
- Five Digits Magic Prediction

|Activities| |Contact| |Front page| |Contents| |Arithmetic|

Copyright © 1996-2018 Alexander Bogomolny

66389683