Sunday Times Teaser 2585 – Easter Teaser
by Victor Bryant
Published: 8 April 2012 (link)
I took the letters A, E, E, R, S and T and wrote down the long list of all possible different combinations of them. So, in alphabetical order, my list was AEERST, AEERTS, . . ., EASTER, . . ., TEASER, . . ., TSREEA. I then assigned each of the letters a different odd digit, turning my list into a list of numbers. Surprisingly, the grand total of my list of numbers contained no odd digit.
What is E+A+S+T+E+R?
One Comment
Leave one →
-
Brian Gladman permalink123456789101112131415161718192021from itertools import permutations# the permutations of the letters in EASTERperms = set(permutations('EASTER'))# for possible solutionssol = set()# permute the letters in EASTERfor p in permutations('EASTR'):# and map them to odd digitsd = dict(zip(p, '13579'))# now sum all the integers formed by permutations# of the digits in this numbers = sum(int(''.join(d[c] for c in w)) for w in perms)# and consider only those withy no odd digitsif not any(int(x) % 2 for x in str(s)):t = sum(int(d[c]) for c in 'EASTER')sol.update([t])print('The sum of the digits of EASTER is {}.'.format(min(sol)))