### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,115)
- misc (2)
- project euler (2)
- puzzle (29)
- site news (43)
- tantalizer (29)
- teaser (3)

### Site Stats

- 166,357 hits

Programming Enigma Puzzles

9 December 2014

Posted by on **From New Scientist #2430, 17th January 2004**

You may have noticed that England won the Rugby Union World Cup.

In this sum to celebrate the hero (or for the Aussie readers the villain) of the hour, the digits 0 to 8 are consistently represented by capital letters, different letters being used for different digits.

No number starts with a zero, and 9 should not be used.

JONNY = WILKI + NSON

Find the 5-digit number represented by JONNY.

[enigma1272]

Advertisements

%d bloggers like this:

The

SubstitutedSum()solver from theenigma.pylibrary can be used to solve this. I added ago()method to the solver that outputs all solutions (that pass an optional filter), which lets you solve problems like this with a one-liner.The following Python program runs in 54ms.

Solution:JONNY = 52331.There are two corresponding sums:

52331 = 48608 + 3723

52331 = 48708 + 3623

L and S are 6 and 7, but it doesn’t matter which way round.