### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,972 hits

Advertisements

Programming Enigma Puzzles

26 March 2012

Posted by on **From New Scientist #2711, 6th June 2009** [link]

I started with a list of six odd numbers, all divisible by 3 (and with no leading zeros, of course). Then I coded the numbers by consistently replacing digits by letters, with different letters used for different digits. The list then became:

MAY IMAGINE MAKING EASY ENIGMA EASIER

(a) Which letter represents 6?

(b) Which digit is represented by N?

[enigma1548]

Advertisements

%d bloggers like this:

This is my original Perl version. It runs in 28ms.

Solution:(a) I = 6, (b) N = 4.And here’s a much more compact (but slower) Python version. It uses the same observation about odd/even numbers as the Perl version, but it permutes the letters assigned to the numbers rather than vice versa. It runs in 149ms.

The following provides a simple but slow solution that can be made much more efficient by building in more intelligence

The digit sum of each word must be a multiple of 3. IMAGINE is an anagram of ENIGMA with an additional I. Since I is even but not 0 it must be 6, I don’t see any short cut for N.