From New Scientist #2520, 8th October 2005
Nimrod is the most famous of Elgar’s Enigma Variations, so it is appropriate that I can write:
In this, digits have been consistently replaced by letters, different letters representing different digits, with the letter O representing the digit zero.
What is the 6-digit number represented by ENIGMA?
News
According to my diary, this was the first Enigma puzzle I programmed a solution for when it was published. Subsequently I only did the puzzles sporadically until Enigma 1482, when I started coding solutions every week. Since putting up my solutions on this site I have been working to provide solutions to previous Enigma puzzles that I didn’t solve at the time of publication. Currently there are 342 Enigma puzzles (and solutions) on the site.
[enigma1361]
When it was published I solved this puzzle using a Perl program with 8 nested loops. It ran in 757ms. I recoded it in Python using
itertools.permutations()
, and that ran in 617ms. But this program uses theSubstitutedSum
solver from the enigma.py library and runs in 50ms.Solution: ENIGMA = 785463.
Now the enigma.py library includes code to invoke the [[
SubstitutedSum()
]] solver directly from the command line this kind of problem can be solved without the need to write a program at all.Run: [ @replit ]
I thought this was quite fitting as Enigma 1361 was the first Enigma puzzle I wrote a program for.
A MiniZinc solution shows why the letter O must be zero – otherwise there would be two more solutions
Without the additional condition ELGAR + ENIGMA = NIMROD has three distinct solutions.
Giving the value of any one of the letters leads to a unique solution, with the exception of A = 3, which gives two solutions.