### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,820 hits

Advertisements

Programming Enigma Puzzles

25 January 2015

Posted by on **From New Scientist #1400, 8th March 1984** [link]

As usual in this letter-for-digits puzzle each letter stands consistently for a digit, different letters representing different digits. This enigma uses a sum and a times:

ENI+GMA=SUM

ENI×GMA= ??MESThat is enough information to determine what the letters stand for, but if you’d like an extra personal clue.

Iis (am?) over twice as big asU.What is

ENIGMA?

[enigma253]

Advertisements

%d bloggers like this:

This program uses the

SubstitutedSum()solver from theenigma.pylibrary to generate solutions to the addition sum, and then checks them against the multiplication sum (and verifies the extra hint). You could easily write a program which usesitertools.permutations()to generate candidate solutions instead.This Python program runs in 91ms.

Solution:ENIGMA = 279156.So the sums are: 279 + 156 = 435 (ENI + GMA = SUM) and 279 × 156 = 43524 (ENI × GMA = SUMES).

You probably want to check permutations of size 8 rather than 9 (M appears twice in ENI + GMA = SUM), and to be strictly correct you would need to verify that the product is indeed a 5 digit number.