Sunday Times Teaser 2933 – Sunday Teaser
by Graham Smithers
Published December 9 2018 (link)
I wrote down two three-figure numbers and worked out their product by long multiplication. Systematically replacing digits by letters, my workings became:
________________ | N | T | S | |||
E | D | S | ||||
— | — | — | ||||
D | U | R | S | |||
Y | R | D | ||||
A | N | D | U | |||
— | — | — | — | — | — | |
A | R | R | A | T | S | |
— | — | — | — | — | — |
I then wrote down two numbers which were represented by SUNDAY TEASER.
What were these two numbers?
One Comment
Leave one →
-
Brian Gladman permalink1234567891011121314151617181920212223242526from itertools import permutations# try all combinations of values for the two multipliersfor D, E, N, S, T in permutations(range(10), 5):nts = 100 * N + 10 * T + Seds = 100 * E + 10 * D + S# check the form of the resulttry:A, R, r, a, t, s = (int(x) for x in str(nts * eds))except ValueError:continueif (a, r, s, t) == (A, R, S, T):# compute Y from the second and U from the third partial productY, rd = divmod(nts * D, 100)U = (E * S) % 10t9 = (A, D, E, N, R, S, T, U, Y)if rd == 10 * R + D and 0 < Y < 10 and len(set(t9)) == 9:sunday = 100000 * S + 10000 * U + 1000 * N + 100 * D + 10 * A + Yteaser = 100000 * T + 10000 * E + 1000 * A + 100 * S + 10 * E + Rprint(f"SUNDAY = {sunday}, TEASER = {teaser} ({nts} x {eds} = "f"{nts * eds}, ADENRSTUY = {''.join(str(x) for x in t9)}).")