# Enigmatic Code

Programming Enigma Puzzles

## Enigma 395: By Jove, it figures!

From New Scientist #1545, 29th January 1987 [link]

In the addition sum below, each of the digits from 0 to 9 has been replaced by a letter whenever it occurs. Different letters stand for different digits. You are asked to reproduce the original sum. [enigma395]

### 3 responses to “Enigma 395: By Jove, it figures!”

1. Jim Randell 12 May 2017 at 8:09 am

Again this can be fed straight into the [[ `SubstitutedSum()` ]] solver from the enigma.py library.

```% python -m enigma SubstitutedSum "SATURN + URANUS = JUPITER"
(SATURN + URANUS = JUPITER)
(943567 + 564759 = 1508326) / A=4 E=2 I=8 J=1 N=7 P=0 R=6 S=9 T=3 U=5
```

Solution: The original sum is: 943567 + 564759 = 1508326.

2. Hugh Casement 12 May 2017 at 9:24 am

>> This was the third substituted addition problem published in four weeks <<

They were never very imaginative, were they?  397 and 399 still to come!
At least these are not quite as bad as the footleball league tables.

3. geoffrounce 12 May 2017 at 10:20 am
```% A Solution in MiniZinc
include "globals.mzn";

var 1..9:S;   var 0..9:A;  var 0..9:T;  var 1..9:U;
var 0..9:R;   var 0..9:N;  var 1..9:J;  var 0..9:P;
var 0..9:I;   var 0..9:E;

constraint all_different([S,A,T,U,R,N,J,P,I,E]);

var 100000..999999 : SATURN = 100000*S + 10000*A +
1000*T + 100*U + 10*R + N;

var 100000..999999 : URANUS = 100000*U + 10000*R +
1000*A + 100*N + 10*U + S;

var 1000000..9999999 : JUPITER = 1000000*J + 100000*U +
10000*P + 1000*I + 100*T + 10*E + R;

constraint SATURN + URANUS = JUPITER;

solve satisfy;

output [ "Original sum is " ++ show(SATURN) ++ " + " ++ show(URANUS)
++ " = " ++ show(JUPITER) ];

% Original sum is 943567 + 564759 = 1508326
% Finished in 134msec

```

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