Firstly, not all numbers have reversible components, e.g. 125.
Secondly, this solution applies only when the components have three digits, although the number itself could be as high as 1998 (= 999 + 999).
Let m be the number you want to decompose into its reversible components.
Let x and y be the components, then
x + y = m
The difference between two, three-digit numbers is evenly divisible by 99. So,
x – y = 99k
where k is some integer 0 … 9. It is the difference between the first and last digit of the larger component, as described in the above article.
y = m – x
x = 99k + y
On substituting m – x for y in the second equation and then adding x to both sides gives
2x = 99k + m
x = (99k + m) / 2
The solution can be found by trying zero and even numbered values of k when m is even and odd numbered values m is odd.
There can be more than one solution to the problem. 685, for example has 3 solutions, namely when k = 1, 3 and 5. This means 685 has four reversible components: 392, 491, 590 and their respective reverses.

Michael Greaney

This question is for testing whether you are a human visitor and to prevent automated spam submissions.