# Enigmatic Code

Programming Enigma Puzzles

## Enigma 491: Times check

From New Scientist #1642, 10th December 1988 [link] These are, in fact, the same product done by long multiplication in two different ways, with the two multiplicands simply reversed in order. Between them, those two three-figure numbers use six different non-zero digits. And the final answer, which is of course the same for both, has all the digits different and non-zero.

[enigma491]

### 3 responses to “Enigma 491: Times check”

1. Jim Randell 11 March 2019 at 6:38 am

We can use the [[ `SubstitutedExpression()` ]] solver from the enigma.py library to solve this problem as a set of alphametic constraints.

This run file executes in 160ms.

Run: [ @repl.it ]

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

SubstitutedExpression

--digits="1-9"
--distinct="ABCDEF,GHIJKL"

# the multiplication
"ABC * DEF = GHIJKL"

# the first sum (ABC * DEF)
"999 < ABC * D < 10000"
"99 < ABC * E < 1000"
"999 < ABC * F < 10000"

# the second sum (DEF * ABC)
"99 < DEF * A < 1000"
"999 < DEF * B < 10000"
"99 < DEF * C < 1000"
```

Solution: The result of the sum is 127458.

The sum is: 291 × 438 = 127458.

Which gives intermediate products of:

291 × 4 = 1164
291 × 3 = 873
291 × 8 = 2328

Writing the sum as: 438 × 291 = 127458, gives intermediate products of:

438 × 2 = 876
438 × 9 = 3942
438 × 1 = 438

2. GeoffR 11 March 2019 at 1:44 pm

We have to assume the missing figures in the teaser description are zeros, which seems reasonable.
I guess you are quoting the internediate products from your solver, rather than the actual partial products, which look to be:
1) 116,400 + 8,730 + 2,328 = 127458
and
2) 87,600 + 39,420 + 438 = 127458

• Jim Randell 11 March 2019 at 3:44 pm

The way I was taught long multiplication at school is consistent with the diagrams shown (although I think we would have done the intermediate products in the reverse order – units, then tens, then hundreds), and in this technique you don’t include the 0’s for the powers of ten in the calculation. Instead the position of the intermediate products shows which column of the result the digit belongs. So the intermediate products I give are the numbers that fit in between the thinner horizontal lines in the diagram.

There have been Enigma puzzles that have used slightly different conventions when laying out long multiplication sums, but it’s usually pretty obvious what they mean.

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