### Random Post

### Recent Posts

### Recent Comments

geoffrounce on Enigma 440: Three X | |

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

Jim Randell on Enigma 440: Three X | |

geoffrounce on Enigma 1106: Not a square… | |

Jim Randell on Tantalizer 458: Knifemen |

### Archives

### Categories

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

### Site Stats

- 177,401 hits

Advertisements

You can use the

SubstitutedSum()solver from theenigma.pylibrary:or the general

SubstitutedExpression()solver:although neither is particularly quick (799ms for

SubstitutedSum(), 1.17s forSubstitutedExpression()).Solution:NIL = 617.When the solution was originally published in

New Scientist#2301 a solution of NIL = 61 was given. A correction to this was published inNew Scientist#2304 giving the correct answer.With a bit more work we can reduce the run-time for the

SubstitutedExpression()solver to a more reasonable 110ms by splitting out the columns as individual sums and including additional symbols (abcde) for the carries (which have a limited set of values). This gives the heuristic algorithm a chance to decide the order in which to consider the columns (instead of the simple right-to-left evaluation done by theSubstitutedSum()solver).If we wanted to, we could specify expressions in the order we wanted them to be evaluated in, and then pass the “

--reorder=0” flag as a solver parameter to tell the solver to consider them in the order specified.The lion’s share of the 110ms spent by the

SubstitutedExpression()solver is in the creation and compilation of the specialised Python program to solve the problem. The actual internal runtime of the specialised program (after compilation) is only 9ms.Here is the appropriate run file:

http://www.iread.it/cryptarithms.php

NIL+TWO+SEVEN+ELEVEN=TWENTY

Solution:

L O N Y I T W S E V

7 4 6 3 1 9 0 2 8 5