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

10 September 2015

Posted by on **From New Scientist #1457, 23rd May 1985** [link]

In the following division sum, some of the digits are missing and some are replaced by letters. The same letter stands for the same digit whenever it appears, and different letters stand for different digits.

Find the correct sum.

This puzzle brings the total number of **Enigma** puzzles on the site to 890. Since the final puzzle was **Enigma 1780** you might expect that we now have 50% of all Enigma puzzles ever published available in the archive. However since there are sometimes multiple puzzles published with the same number (typically at Christmas) I don’t think we’re quite there yet. But I’ll be marking the “half-way” milestone sometime next week.

[enigma309]

Advertisements

%d bloggers like this:

This is exactly the kind of problem I wrote the

SubstitutedDivision()solver in theenigma.pylibrary for. This Python program runs in 159ms.Solution:There correct sum is 202616 ÷ 43 = 4712.Note:Originally I published a program that found 10 solutions to the sum, but this was because the solver is not given the first line of the intermediate subtraction sums to check, so it failed to check the g in the third intermediate sum. I shall update the solver so that the entire intermediate sum can be checked.In the version in my files, the dividend has the G in the tens place.

Not sure whether I found it in the NS archive or on Google Books.

I used the Google Books archive as the source for this puzzle [ https://books.google.co.uk/books?id=l2o3GceSPyAC&lpg=PP1&pg=PA46#v=onepage&q&f=false ] (I also reference my source for the puzzles via the [link] after the New Scientist issue number and date).

Perhaps a correction was published, but I didn’t find it when I looked.

Referring to Hugh’s note above, in the puzzle text, “g” is shown in the line below “ky-“. Doesn’t that mean the “g” is automatically the tens digit in the dividend?

Of course, you are right. Sadly this means there must be a mistake in my solver because some of the solutions it comes up with have two different values for g. I shall investigate it.

Ah, I see. It’s because my program doesn’t look at the first line of the intermediate subtraction sums (they are not even given to it to look at), so it’s missing checking the g in the third intermediate sum (?g − m? = x), and that’s why it comes up with multiple solutions, but if you copy the g up into the dividend it finds the unique solution.

I’ve removed the “flawed” tag and I’ll update my original comment above.

Good luck with that and here’s encouraging you to keep passing the milestones – my retirement is mentally energised HUGELY by your Enigmas. I happily do all of them without the help of Python – Excel is wonderfully useful.

Julian, I’ll echo your comment about the mental stimulus Jim provides for us retired people. And you’ve solved the puzzle of where I got that missing letter. Easy to overlook the obvious!

Hope I can be forgiven for mentioning ST Teaser no. 2762 out of context. The solution is rather well hidden on Brian’s web site (amongst the discussion of other possible or improbable polyhedra). I knew it had to be 9, 9, 16 (Danke, Herr Euler!), but couldn’t see how to fit the faces together. There’s an octagonal top, each edge shared with one triangular face, the opposite vertices of those eight triangles all meeting at a point at the base of the gemstone.

In the 2015-09-15 version of the

enigma.pylibrary you can optionally fully specify the intermediate sums when calling theSubstitutedSum()solver, and it will check them against the specified dividend and modify it accordingly.The following program uses fully specified intermediates, and finds the unique answer.

Although it’s not necessary to fully specify intermediates that don’t add any new information. So we can just fully specify the third intermediate sum, and get the same result.

Or you can manually copy up the information into the dividend directly and use

SubstitutedSum()as before. (This is the same as the program given in my original comment).