**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.

[enigma328]

### Like this:

Like Loading...

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.

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.