### 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

We can use the

SubstitutedDivision()solver from theenigma.pylibrary to solve this in 436ms.However, we can get a faster solution (although with more typing) by using the

SubstitutedExpression()solver.This run file translates the lower case letters in the original sum to upper case and adds additional upper case letters for the dashes. The complete run time is 147ms.

Solution:The correct sum is 305283 ÷ 33 = 9251.Even without the additional condition that all the digits in the result are different there is only one solution.

I used lowercase versions of the letters you used in my solution and got the same answer

ie 9251 X 33 = 305283 in 84 msec.

The programme was a bit long in MiniZinc, but I wanted to try a division alphametic in MiniZinc

I used ‘FG’ (lowercase) in the multiplications (as your statement of the puzzle) but noticed you say ‘EF’ in the solver for the divisor? Anyway, I get the same answer.

@geoff: Thanks for pointing out the EF / FG mix-up. I renamed some of the symbols I used before posting my code, but I must have missed changing them in the multiples. Fortunately it turns out that E, F and G all stand for 3, so it didn’t affect the result of the program, but I’ve sorted it out now.

I’d been considering writing code to automatically turn these problems into expressions that can be fed directly into the

SubstitutedExpression()solver without manual intervention. So maybe it’s time to look at that again.This puzzle has led me to make the “distinct” parameter for the

SubstitutedExpression()solver more flexible.This means we can now specify multiple sets of symbols, and the values of the symbols in each set have to be distinct from the values of the other symbols

in that set, but may be the same as the value of symbols in different sets.This removes the need for the

"is_pairwise_distinct(H, I, J, L)"expression (line 38) in my solution using theSubstitutedExpression()solver. Instead we can just specify the “distinct” parameter as--distinct="DKRT,HIJL"at line 20. The rest of the file remains the same.This functionality is available in

enigma.pyfrom version 2017-03-24.The new implementation of the

SubstitutedDivision()solver in theenigma.pylibrary is derived fromSubstitutedExpression()so we can use the same technique to require the digits of the result to be distinct, but we don’t need to specify symbols for the rest of the sum.Here’s a run-file that uses the new

SubstitutedDivision()solver. It executes in 179ms.