### Random Post

### Recent Posts

### Recent Comments

Jim Randell on Puzzle #52: Bus change | |

Jim Randell on Enigma 967: Prime cubes | |

GeoffR on Enigma 1707: Making progr… | |

Jim Randell on Enigma 1707: Making progr… | |

Jim Randell on Tantalizer 409: Fe, Fi, Fo,… |

### Archives

### Categories

- article (11)
- enigma (1,364)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (47)
- site news (58)
- tantalizer (92)
- teaser (7)

### Site Stats

- 231,894 hits

This program uses the [[

`SubstitutedSum()`

]] solver from theenigma.pylibrary to generate solutions to the addition sum, and then checks them against the multiplication sum (and verifies the extra hint). You could easily write a program which uses [[`itertools.permutations()`

]] to generate candidate solutions instead.This Python program runs in 91ms.

Solution:ENIGMA = 279156.So the sums are: 279 + 156 = 435 (ENI + GMA = SUM) and 279 × 156 = 43524 (ENI × GMA = SUMES).

You probably want to check permutations of size 8 rather than 9 (M appears twice in ENI + GMA = SUM), and to be strictly correct you would need to verify that the product is indeed a 5 digit number.