### 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

18 August 2013

Posted by on **From New Scientist #1262, 16th July 1981** [link]

Long multiplication and long division were never too popular at school, unless of course they were made considerably easier by involving multiplication or division by 10. So this week’s exercise is a simple (?) calculation involving multiplication by TEN.

Usual letters-for-digits rules apply: a letter stands for a particular digit throughout, and different letters stand for different digits. The letters already shown can, of course, also be used to fill the blanks, but need not be.

What is ENIGMA?

[enigma118]

Advertisements

%d bloggers like this:

This Python program runs in 65ms.

Solution:ENIGMA = 163072 (= 416 × 392).A permutation solution also works, but takes a few seconds longer:

The problem can be recast as a long division sum, and then the

SubstitutedDivision()solver fromenigma.pycan be used on it. This program runs in 99ms.hi can u please explain the logic how to solve

The basic idea is to substitute the letters for (different) digits, so that the long multiplication sum makes sense. This means the assignment of letters has to be chosen such that the intermediate products also make sense. (The puzzle presents them in the opposite order I would have expected, which is why I re-wrote the sum in the initial comment of my first program).

You can do this with pencil and paper or write a computer program to do it for you. My programs try possible assignments of letters to digits, until it finds one that gives a sum that fits the diagram.