### Random Post

### Recent Posts

### Recent Comments

Hugh Casement on Enigma 1070: Time to work | |

Jim Randell on Enigma 1070: Time to work | |

Jim Randell on Enigma 1070: Time to work | |

geoffrounce on Enigma 440: Three X | |

Jim Randell on Enigma 1588: As easy as 1… |

### Archives

### Categories

- article (11)
- enigma (1,157)
- misc (2)
- project euler (2)
- puzzle (39)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,567 hits

Advertisements

Here’s my first attempt in Python. It’s not very quick though, it takes 4.5s under PyPy. I shall see if I can come up with a more efficient version later.

Solution:The odd number out is 185.The non-square is OUT, with value 185.

The remaining numbers are: CAST = 3025 (55²), THE = 576 (24²), ODD = 144 (12²), ONE = 196 (14²).

Here is my program:

OK, here’s a more efficient version. It runs in 246ms.

And here’s a version that uses the

SubstitutedExpression()solver from theenigma.pylibrary (which didn’t exist when the puzzle was originally posted).It considers the problem as 5 different alphametic puzzles, where each one considers a different candidate word as being the non-square. It runs in 102ms.

And here’s yet one more

It is easy to deduce that the non-square has to be one of ODD, ONE or OUT, so I intended the code to test all these cases, but got lucky by finding that OUT is the non-square. The code runs in 35ms

Code tidied up a bit :

Printing out the values of the five numbers enabled the non – square number to be identified.

Would have been better if the answer could have been found as a totally programmatic solution, but not sure if this is possible in MiniZinc.

@Jim: Any ideas?

@geoff: You could add the following to your model:

And have [[

"non-square = " ++ show(non_square)]] in theoutputclause to get the solution displayed.@jim: Thanks – that’s a neat solution to give a fully programmatic solution.