# Enigmatic Code

Programming Enigma Puzzles

## Puzzle 85: Addition: digits all wrong

From New Scientist #1137, 11th January 1979 [link]

In the following addition sum all the digits are wrong. But the same wrong digit stands for the same correct digit wherever it appears, and the same correct digit is always represented by the same wrong digit.

This puzzle was republished in New Scientist #1316 (29th July 1982) as Enigma 171.

[puzzle85]

### One response to “Puzzle 85: Addition: digits all wrong”

1. Jim Randell 4 January 2017 at 9:07 am

We’ve already solved this puzzle using the SubstitutedSum() solver from enigma.py when it was set as Enigma 171.

The puzzle can also be solved using the SubstitutedExpression() solver from enigma.py. We can either substitute the numbers in the sum for capital letters (which are the default symbols) or just declare the symbols directly.

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

# solver to use
SubstitutedExpression
--symbols="01356789"

# symbols cannot stand for themselves
# and also 1 and 6 cannot be zero
-i0,016 -i1,1 -i3,3 -i5,5 -i6,6 -i7,7 -i8,8 -i9,9

# expression to solve
"1939 + 1079 = 6856"
```

Solution: The correct sum is 2767 + 2137 = 4904.