Brainteaser 1791: Untied problem
From The Sunday Times, 12th January 1997 [link]
Here is an exact long division sum. In some places digits have been consistently replaced by letters, with different letters used for different digits. In all other places the digits have been replaced by asterisks.
Untie this and find UNTIED.
This puzzle is included in the book Brainteasers (2002). The puzzle text above is taken from the book and differs slightly from the original puzzle.
[teaser1791]

Jim Randell 8:13 am on 10 March 2020 Permalink |
We can use the [[
SubstitutedDivision()]] solver from the enigma.py library to solve this puzzle.The following run file executes in 147ms.
Run: [ @repl.it ]
Solution: UNTIED = 986304.
The correct division sum is: 986304 ÷ 132 = 7472.
LikeLike
GeoffR 6:32 pm on 10 March 2020 Permalink |
from itertools import permutations for P in permutations('1234567890', 9): j, i, m, u, n, t, e, d, a = P # leading digits must not be zero if j == '0' or a =='0'or u == '0': continue jim = int(j + i + m) untied = int(u + n + t + i + e + d) adam = int(a + d + a + m) if jim * adam == untied: # check the lone 'D' position is correct if (int(a) * jim) % 10 == int(d): print (f"Sum is {untied} / {jim} = {adam}") # Sum is 986304 / 132 = 7472 # There are only two solutions to the main division sum: # 986304 / 132 = 7472 # and 785601 / 369 = 2129 # Checking the lone 'D' digit position is enough to eliminate the # second solution ie 785601 / 369 = 2129. The last line of the # second solution also has 4 digits, instead of 3 digits. # It ran in 112 msec.LikeLike