# Enigmatic Code

Programming Enigma Puzzles

## Puzzle 31: Division. Figures all wrong

From New Scientist #1082, 15th December 1977 [link]

In the following, obviously incorrect, division sum the pattern is correct, but every single figure is wrong.

Find the correct figures. (The correct division comes out exactly. All the digits in the answer are only 1 out, but all the other digits may be incorrect my any amount).

[puzzle31]

### One response to “Puzzle 31: Division. Figures all wrong”

1. Jim Randell 16 January 2019 at 9:33 am

Here is a solution using the [[ `SubstitutedDivision()` ]] solver from the enigma.py library. It runs in 125ms.

Run: [ @repl.it ]

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

#            H I J
#      -----------
#  A B ) C D E F G
#          K L
#        -----
#          M N F
#          O P Q
#          -----
#              R G
#              R G
#              ===

# solver to use
SubstitutedDivision

# solver parameters
--distinct=""
--invalid="0,ACDHIKLMOR"
--invalid="1,AIJ"
--invalid="2,CHIMO"
--invalid="3,BFIJ"
--invalid="4,GHIJ"
--invalid="5,HIJPR"
--invalid="6,EGHJN"
--invalid="7,HIJ"
--invalid="8,HJKQ"
--invalid="9,HIJ"

# the division sum
"CDEFG / AB = HIJ"

# the intermediate subtraction sums
"CDE - KL = MN"
"MNF - OPQ = R"
"RG - RG = 0"
```

Solution: The correct sum is: 11222 ÷ 31 = 362.

This site uses Akismet to reduce spam. Learn how your comment data is processed.