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

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.