Sunday Times Teaser 2934 – Good Arraz, Baz
by Stephen Hogg
Published December 16 2018 (link)
Baz’s three darts hit the board, scoring different numbers from 1 to 20. “Curious numbers,” said Kaz. Baz looked puzzled. Kaz explained that the first dart’s score to the power of the second dart’s score is a value that contains each numeral 0 to 9 at least once and has the third dart’s score number of digits. Baz only saw that the third dart’s score was the difference between the other two darts’ scores. Kaz wrote the full value on a beer mat. Then Baz put his glass on it and covered most of the value, leaving just the first dart’s score showing to the right and the second dart’s score to the left.
What did each dart score in the order thrown?
2 Comments
Leave one →
-
Brian Gladman permalink123456789101112131415# the first two dart scoresfor a in range(2, 21):for b in range(7, 21):# the power (as a string)sp = str(a ** b)# the third dart scorec = len(sp)# check the third dart score, that there are three different scores and that# the power contains all ten digitsif c == abs(a - b) and len({a, b, c}) == 3 and set(sp) == set('0123456789'):# check the power for the correct prefix and suffixassert (sp[:len(str(b))], sp[-len(str(a)):]) == (str(b), str(a))print(f'The dart scores are {a}, {b} and {c} ({a}^{b} == {sp}).')
-
geoffrounce permalink12345678910for a in range(1, 21):for b in range(1, 21):s = str(a ** b)c = len(s)if len({a, b, c}) != 3 or set(s) != set('1234567890'): continueif abs(b - a) != c: continueif s[:len(str(b))] == str(b) and s[-len(str(a)):] == str(a):print('Darts score order was {}, {}, and {}'.format(a, b, c))