### Random Post

### Recent Posts

- Puzzle 69: Division: letters for digits
- Enigma 1106: Not a square unused
- Enigma 405: Uncle bungles the answer
- Enigma 401: Uncle bungles the answer
- Puzzle 70: Football five teams: new method
- Enigma 1107: Factory work
- Enigma 404: Regular timepiece
- Tantalizer 477: Precognition
- Enigma 1108: Every vote counts
- Enigma 403: Taking stock

### Recent Comments

geoffrounce on Enigma 1755: Sudoprime II | |

saracogluahmet on Enigma 1740: Sudoprime | |

Jim Randell on Enigma 1740: Sudoprime | |

geoffrounce on Enigma 1740: Sudoprime | |

geoffrounce on Enigma 1730: Prime positi… |

### Archives

### Categories

- article (11)
- enigma (1,087)
- misc (2)
- project euler (2)
- puzzle (23)
- site news (42)
- tantalizer (23)
- teaser (3)

### Site Stats

- 159,095 hits

This Python program uses the

SubstitutedSum()solver from theenigma.pylibrary (originally written forEnigma 63). It runs in 350ms.Solution:IBIZA = 12183.There are two ways of arriving at the solution as the values for the letters D and X are interchangeable.

Only using the site http://www.iread.it and Excel

SAND+SUN+SEX+SEA=IBIZA

9306+970+954+953=12183

OR

9304+970+956+953=12183

A standard permutation solution:

If you’re interested in a little Python tip you could write the ordering inequality as:

It looks neater, and it may be a tiny bit more efficient.

The ordering inequality suggested looks good for Python, but did not work for me in MiniZinc

Without the ordering inequality, IBIZA can be 10128, 10148, 10168, 10189 or 12183.

Pingback: Enigma 1407: SAND + SUN + SEA + SEX = IBIZA | Ben's Blogs, Books & Pix

This puzzle was also one of the examples I used when writing the generalised Alphametic solver in the

enigma.pylibrary (SubstitutedExpression()). See the articlesSolving Alphametics with PythonandSolving Alphametics with Python, Part 2for more details.Using the command-line invocation we can solve the problem in 391ms. Here is the command and its output: