### 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,818 hits

Advertisements

Programming Enigma Puzzles

22 May 2017

Posted by on **From New Scientist #2270, 23rd December 2000** [link]

Christmas is said to change things and so this enigma is an old puzzle with some changes.

Problem:You have to assign a digit to each of the 10 letters in the sum here:When you have decided on an assignment of digits to the 10 letters, then your assignment is a solution of the problem if it satisfies at least one of the following conditions:

• At least one digit is assigned to more than one letter.

• When the digits are put into the addition sum it is not correct.

• The digit assigned to “U” is smaller than the digit assigned to “H”.You need to find an assignment of digits to the 10 letters which is

NOTa solution of the problem.What is the value of BLEAT in your assignment?

[enigma1114]

Advertisements

%d bloggers like this:

We need to find an assignment of digits to letters that is

nota solution to the embedded problem.So all the listed conditions must be

false. i.e. No digits are assigned to more than one letter;andthe sum must come out correctly when the digits are substituted in;andthe digit assigned to “U” is larger than the digit assigned to “H”.In other words this is a straightforward alphametic sum puzzle, so we can use the

SubstitutedSum()solver from theenigma.pylibrary, with a check on the solutions to ensureU > H.This program runs in 64ms.

Solution:BLEAT = 68570.The full sum is:

Without the condition that

U > Hthere is a further solution:We can also use the generalised alphametic solver (

SubstitutedExpression()) that is part of theenigma.pylibrary to save us having to write a program at all. Here’s the run file. It executes in 144ms.