Enigmatic Code

Programming Enigma Puzzles

Enigma 380: Answer what?

From New Scientist #1529, 9th October 1986 [link]

In the following division sum each letter stands for a different digit:

Write the sum out with the letters replaced by digits.

[enigma380]

One response to “Enigma 380: Answer what?”

1. Jim Randell 20 January 2017 at 7:28 am

We can see that there are 4 intermediate subtraction sums, so the result of the division is a 4-digit number, and the multiples of the divisor all have either 2 or 3 digits, so the divisor is a 2-digit number.

So we can use the SubstitutedDivision() solver from the enigma.py library to solve this puzzle. It takes 113ms.

```#!/usr/bin/env python -m enigma -r

# solver to use
SubstitutedDivision

# the division sum
"kxxky / ?? = ????"

# the intermediate subtraction sums
"kx - ph = bd"
"bdx - gpx = rm"
"rmk - ypk = ym"
"ymy - ymg = g"
```

Solution: The correct division sum is given below:

Or, we can use the SubstitutedExpression() solver from the enigma.py library to get a solution in 93ms.

```#!/usr/bin/env python -m enigma -r

# solver to use
SubstitutedExpression

# parameters
--symbols="bdghkmprxyABCDEF"
--distinct="bdghkmprxy"

# the division sum
"AB * CDEF + g = kxxky"

# the multiples
"AB * C = ph"
"AB * D = gpx"
"AB * E = ypk"
"AB * F = ymg"

# the intermediate subtraction sums
"kx - ph = bd"
"bdx - gpx = rm"
"rmk - ypk = ym"
"ymy - ymg = g"
```