**From New Scientist #1331, 11th November 1982** [link]

No morning papers — hence a glassy rumination of my Honeyed Weety Fingees, contents and package both. Slowly, the significance of four crude over-printed stock numbers percolated my abstractions.

The numbers each had the same number of digits. The smallest plus the next-to smallest numbers summed to another of the numbers; the total was identical to the smallest number except that the order of the digits was exactly reversed. Adding the smallest number to the total just obtained produced a new total which was one of the two numerical palindromes featured in the group.

But for two exceptions, the digits 1 to 9 were all evident, but 0 was not. I noticed at least two digits which each appeared four times within the group, all other digits appeared just twice each.

What was the highest number within the group?

[enigma186]

### Like this:

Like Loading...

A bit of analysis narrows down the possible digit lengths of the numbers. This recursive Python program runs in 2.1s (under PyPy).

Solution:The highest number of the group is 774477.The numbers (in order) are: 112266, 549945, 662211, 774477.

If we accept that “all other digits appeared just twice” means that there is at least one digit that appears twice, then we can restrict the search to only examining 5 and 6 digit numbers. With this modification the program runs in 384ms.