### Random Post

### Recent Posts

- Enigma 426: Time and again
- Enigma 1084: 1-2-3 triangles
- Tantalizer 466: Diplomacy
- Tantalizer 467: Nine men went to mow
- Enigma 1085: Cut and run
- Enigma 425: Them thar’ Hills
- Puzzle 60: Uncle Bungle gets the last line wrong
- Enigma 1086: Stacking trays
- Enigma 424: A round of fractions
- Tantalizer 468: Shell fire

### Recent Comments

Brian Gladman on Enigma 426: Time and agai… | |

Jim Randell on Enigma 426: Time and agai… | |

Jim Randell on Enigma 1084: 1-2-3 triang… | |

Brian Gladman on Enigma 1084: 1-2-3 triang… | |

Jim Randell on Enigma 1084: 1-2-3 triang… |

### Archives

### Categories

- article (11)
- enigma (1,129)
- misc (2)
- project euler (2)
- puzzle (32)
- site news (43)
- tantalizer (34)
- teaser (3)

### Site Stats

- 169,972 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 usesitertools.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.