### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,129 hits

Programming Enigma Puzzles

19 October 2018

Posted by on **From New Scientist #2196, 24th July 1999** [link]

I have written down a sum:

The three numbers between them use each of the digits 1-9 exactly once.

One of the three numbers is a perfect cube and another uses a collection of consecutive digits in some order.

What is the cube?

[enigma1040]

%d bloggers like this:

This Python program uses the [[

`SubstitutedSum()`

]] solver from theenigma.pylibrary.It runs in 181ms.

Run:[ @repl.it ]Solution:The cube is 729.If we require the smallest summand to appear first there are only three possible alphametic sums that fit the pattern:

If all symbols are required have distinct values the first of these has no solutions.

Additionally if the digit 0 is not used the second of these has no solutions.

This leaves

ABC + DEF = GHIwhich has 168 solutions as an alphametic that doesn’t involve zero digits.Requiring one of the numbers to be a perfect cube, and another one to consist of three consecutive digits (in some order), narrows these down to only two possible solutions:

In both cases the result of the sum is the perfect cube 729 (= 9^3).

In the second case the number composed of consecutive digits (543) has them in descending order, so by tightening the wording of the puzzle it could have identified a specific sum.

This programme identifies a specific sum, as identified by Jim, but does not consider all possible alphametic sums.