Dear reader: Think in a natural number \(abc\) with three digits, with \(a\neq c\). Then, secretly, revert the order of the digits, obtaining \(cba\), and compute the difference between the bigger and the smaller number. It is enough that you tell us which is the first digit of that difference for us to tell you which was the number in which you thought.

We can find out how this trick works with some examples. For instance, if \(abc=165\), then \(cba=561\) and \(cba-abc=396\); if \(abc=990\), then \(cba=099\) and \(abc-cba=891\). In general, under the assumptions made for the trick, the difference \(abc-cba\) (or \(cba-abc\)) is always a number of the form \(\alpha9\beta\) and, moreover, one has \(\alpha+\beta = 9\). Therefore, knowing \(\alpha\), we get the number.

The value of \(\alpha + \beta\) should not be surprising: indeed, given any number and its reverse (obtained by reversing the order of the digits), the sum of the digits is the same, and so both numbers are in the same class modulo \(9\). Therefore, the difference between them is a multiple of \(9\). The image of the transformation \(f\), which acts on the set \(N_{3}\) of natural numbers with three digits (allowing zeros on the left), and that to each number associates the distance between the number and its reversed version, contains only ten elements, namely \[\{000, 099, 198, 297, 396, 495, 594, 693, 792, 891\}.\]

Notice also that, since the domain of the function \(f\) is finite, if we iterate \(f\), obtaining for each element \(x\) of \(N_{3}\) the respective orbit by \(f\), we must reach a cycle, whose elements belong to the image of the function \(f\). Looking at the ten aforementioned numbers, we see that \(000\) is a fixed point of \(f\), attracting all numbers \(abc\) with \(a=c\); and that \[099\rightarrow 891\rightarrow 693\rightarrow 297\rightarrow 495\] is a cycle with period \(5\), at which every other orbit arrives, in no more than two iterations of \(f\) (see the next picture).

Cycles and precycles in \(N_{3}\).

Click on the picture to see it in a bigger size.

Translated for Atractor by a CMUC team, from its original version in Portuguese. Atractor is grateful for this cooperation.

This work integrates interactive components in CDF format prepared with the Mathematica program. To use these files, you must install on your computer the CDF Player, which can be downloaded for free from