### Random Post

### Recent Posts

### Recent Comments

Jim Randell on Enigma 544a: Merry Christ… | |

Jim Randell on Puzzle #52: Bus change | |

J. Pijnenburg on Puzzle #52: Bus change | |

Jim Randell on Puzzle #53: Painting by n… | |

GeoffR on Puzzle #52: Bus change |

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (93)
- teaser (7)

### Site Stats

- 233,055 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: