### Random Post

### Recent Posts

### Recent Comments

Brian Gladman on Enigma 1057: Recycled cha… | |

Jim Randell on Enigma 1057: Recycled cha… | |

geoffrounce on Enigma 452: Figure out these… | |

Jim Randell on Enigma 452: Figure out these… | |

Jim Randell on Enigma 1627: A riddle for the… |

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,903 hits

Advertisements

Another Enigma that is easily solved in Python. Runtime: 30ms.

Solution:The initial 5 digit square was 39204.couldn’t get the square function to work in P3.1, so here’s my mod version.

The

square()function (now renamedis_square()) is from my own library of useful functions for solving Enigma puzzles, you can get it at http://www.magwag.plus.com/jim/enigma.html (and I put some[sourcecode language="python"]...[/sourcecode]tags around your code to show the indents properly).We can solve this problem using the general Alphametic expression solver (

SubstitutedExpression()) in theenigma.pylibrary.We use the

--distinct=""parameter to allow the same digit to be substituted for different letters.Here is the command and it’s output:

The command runs in 170ms.