### 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,896 hits

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 renamed [[`is_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.