Sunday Times Teaser 2863 – Little Time
by Graham Smithers
Published August 6 2017 (link)
Do you have a little time to try this Teaser? I have taken a four-figure number and a six-figure number and I have consistently replaced digits by letters to give the words LITTLE and TIME.
If you take the digits of TIME and write down all the four-figure numbers which use exactly those digits in some order and then add up all those numbers, then your total will be LITTLE.
What number is TIME?
One Comment
Leave one →
-
Brian Gladman permalink12345678910111213141516171819202122from itertools import permutationsfrom functools import reduce# permute digits for the letters in LITTLEfor E, I, L, T in permutations(range(10), 4):# compute the numeric value of LITTLElittle = reduce(lambda x, y : 10 * x + y, (L, I, T, T, L, E))# since in all the permutations of four digits each digit occurs# in each position six times, LITTLE must be a multiple of 6666q, r = divmod(little, 6666)if not r:# compute M from T, I, M and the now known sum of T, I, M and EM = q - (T + I + E)# check that M is a valid digit different from E, I, L and Tif 0 <= M < 10 and M not in (E, I, L, T):time = reduce(lambda x, y : 10 * x + y, (T, I, M, E))print(f'TIME = {time} (LITTLE = {little}).')