### Random Post

### Recent Posts

- Tantalizer 450: Marriage problems
- Enigma 1057: Recycled change
- Enigma 452: Figure out these letters
- Puzzle 46: I lose my specs
- Enigma 1058: A row of colours
- Enigma 451: Double halved
- Tantalizer 451: Death rates
- Enigma 1059: Century break
- Enigma 450: A pentagonal problem
- Puzzle 48: Verse on the island

### Recent Comments

Jim Randell on Tantalizer 450: Marriage … | |

Brian Gladman on Enigma 1057: Recycled cha… | |

Jim Randell on Enigma 1057: Recycled cha… | |

geoffrounce on Enigma 452: Figure out these… | |

Jim Randell on Enigma 452: Figure out these… |

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (50)
- teaser (3)

### Site Stats

- 184,974 hits

Advertisements

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: