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

- 178,002 hits

Advertisements

Programming Enigma Puzzles

15 January 2016

Posted by on **From New Scientist #1476, 3rd October 1985** [link]

Nine men went to mow, went to mow a meadow. Write “9” in one of the meadows. Eight men left the ninth in the meadow and went through a gate into the next. Write “8” in the meadow they went into. Seven men left the eighth behind and went through a gate. Write “7” in the meadow they went into. Carry on in this way until you have “6”, “5”, “4”, “3”, “2” and “1” duly inscribed in the remaining meadows. You must use a gate each time and never enter the same meadow twice.

That gives you a three-digit number on each of the three lines. Try adding the top number to the middle number and see if they sum to the bottom number. If not, bad luck — you’ll have to sing the song all over again.

When you have got it right, please give the completed grid.

This puzzle had previously been published in **New Scientist #1018** as **Tantalizer 467**.

[enigma328]

Advertisements

%d bloggers like this:

This Python 3 program generates all possible arrangements of the grid, and then checks to see if the first two rows sum to the third.

It runs in 55ms, so there seems little point in optimising it.

Run:[ @repl.it ]Solution:The completed grid is shown below:Here’s an alternative solution, which starts by solving the substituted sum problem (using the

SubstitutedSum()solver from theenigma.pylibrary), and then checks the adjacency condition. It’s a shorter, but slightly slower program. It runs in 90ms.