### Random Post

### Recent Posts

- Enigma 426: Time and again
- Enigma 1084: 1-2-3 triangles
- Tantalizer 466: Diplomacy
- Tantalizer 467: Nine men went to mow
- Enigma 1085: Cut and run
- Enigma 425: Them thar’ Hills
- Puzzle 60: Uncle Bungle gets the last line wrong
- Enigma 1086: Stacking trays
- Enigma 424: A round of fractions
- Tantalizer 468: Shell fire

### Recent Comments

Brian Gladman on Enigma 426: Time and agai… | |

Jim Randell on Enigma 426: Time and agai… | |

Jim Randell on Enigma 1084: 1-2-3 triang… | |

Brian Gladman on Enigma 1084: 1-2-3 triang… | |

Jim Randell on Enigma 1084: 1-2-3 triang… |

### Archives

### Categories

- article (11)
- enigma (1,129)
- misc (2)
- project euler (2)
- puzzle (32)
- site news (43)
- tantalizer (34)
- teaser (3)

### Site Stats

- 169,972 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: