Sunday Times Teaser 2535 – Eastertide
by Andrew Skidmore
Published: 24 April 2011 (link)
In the following division sum I have consistently replaced digits with letters, with different letters used for different digits. All three numbers featured are even:
EASTER ÷ TIDE = EGG
What is the numerical value of my TEASER?
One Comment
Leave one →
-
Brian Gladman permalink12345678910111213141516171819202122232425from itertools import permutationsfrom functools import reduce# permute even digits for known 'even' lettersfor E, G, R in permutations(range(0, 10, 2), 3):# now permute the remaining digits for I, D and Tfor I, D, T in permutations(set(range(10)).difference([E, G, R]), 3):# the three valuestide = 1000 * T + 100 * I + 10 * D + Eegg = 100 * E + 11 * Geaster = tide * egg# check that EASTER is the right lengthif 100000 <= easter < 1000000:# now check that known letter values in EASTER are correcte1, A, S, t1, e2, r1 = map(int, str(tide * egg))if e1 == e2 == E and t1 == T and r1 == R:teaser = reduce(lambda x, y: 10 * x + y, (T, E, A, S, E, R))print('TEASER = {}'.format(teaser))