Sunday Times Teaser 2949 – Mystery Numbers
by Graham Smithers
Published March 31 2019 [link]
I wrote down a 2-digit number and a 5-digit number and then carried out a long division.
I then erased all of the digits in the calculation, other than one of them, which I have indicated by #.
This gave me the image above.
What were my two original numbers?
One Comment
Leave one →
-
Brian Gladman permalink12345678910111213141516171819202122232425262728293031323334353637383940# symbols for digits: a h ) h h b c h# form the divisorfor a in range(1, 10):for h in range(1, 10):div = 10 * a + h# form the dividendfor bc in range(100):dnd = 11001 * h + 10 * bc# form the quotient and (zero) remainderq, r = divmod(dnd, div)if r or not 1000 <= q < 10000:continue# the first partial sumt1 = 11 * hb1 = div * (q // 1000)t2 = 10 * (t1 - b1) + bc // 10if not (b1 % 10 == h and 10 <= b1 < 100 and 100 <= t2 < 1000):continue# the second partial sumb2 = div * ((q // 100) % 10)t3 = 10 * (t2 - b2) + (bc % 10)if not (10 <= b2 < 100 and 100 <= t3 < 1000):continue# the third partial sumb3 = div * ((q // 10) % 10)t4 = 10 * (t3 - b3) + hif not (100 <= b3 < 1000 and (b3 // 10) % 10 == h and 10 <= t4 < 100):continue# the fourth partial sumif t4 == div * (q % 10):print(f"{dnd} / {div} == {q}")