1089 and A Property of 3-Digit Numbers
1089 and A Property of 3-Digit Numbers
1089 and A Property of 3-Digit Numbers
(https://www.cut-the-knot.org/manifesto/index.shtml)
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: 495 + 594. Here comes the surprise: regardless of your original selection, the final result will always be 1089!
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.
If you are reading this, your browser is not set to run Java
applets. Try IE11 or Safari and declare the site https:///www.cut-
the-knot.org as trusted in the Java setup.
https://www.cut-the-knot.org/Curriculum/Arithmetic/S1089.shtml 1/4
6/1/2019 1089 and a Property of 3-digit Numbers
For any integer A, let A' be obtained by writing A backwards. Compute B = |A - A'| and
C = B + B'.
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 A - A' can occasionally produce numbers shorter than specified. When this
happens, then B before being written backwards is padded with zero in front to insure the required number of digits. For
example, B = 87, B' = 780 because the padded B is a 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.
Now, for a 2-digit numbers A = 10a + b (1 ≤ a ≤ 9, 0 ≤ b ≤ 9), A' = 10b + a, and, assuming without loss of generality that
a ≥ b, B = A - A' = 10(a - b) + (b - a). The case a = b is trivial as then B = 0. Otherwise, i.e., with a > b,
This modification is necessary because b - a is negative. The new form of B has the advantage that
https://www.cut-the-knot.org/Curriculum/Arithmetic/S1089.shtml 2/4
6/1/2019 1089 and a Property of 3-digit Numbers
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' = 10(10 + b - a) + (a - b - 1). Next
we add:
For a 3-digit decimal number A = 100a + 10b + c, A' = 100c + 10b + a. For a palindromic number (a = c), again B = 0.
To exclude this case, assume a > c, making A > 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:
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.
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
1. D. Acheson, 1089 and All That: A Journey into Mathematics
(https://www.amazon.com/exec/obidos/ISBN=0199590028/ctksoftwareincA/), Oxford University Press, 2010
https://www.cut-the-knot.org/Curriculum/Arithmetic/S1089.shtml 3/4
6/1/2019 1089 and a Property of 3-digit Numbers
1. 1089 and a Property of 3-digit Numbers
2. Four Digits Magic Prediction (https://www.cut-the-
knot.org/Curriculum/Arithmetic/FourDigitsPrediction.shtml)
3. Five Digits Magic Prediction (https://www.cut-the-
knot.org/Curriculum/Arithmetic/FiveDigitsPrediction.shtml)
64888427
https://www.cut-the-knot.org/Curriculum/Arithmetic/S1089.shtml 4/4