Sunday Times Teaser 2900 – An Ancestral Equation
by Susan Bricket
Published April 22 2018 (link)
I recently discovered a 16th century ancestor called David, which happens to be my maiden name. (I never really liked Bricket, even when pronounced in the French way.) I have always been partial to word arithmetic (or cryptarithms) and the other day I found a solution to this one:
MY x NAME = DAVID
When eight distinct digits are substituted for the eight letters and no number starts with zero, the equation holds. Amazingly the solution gave me more information about my ancestor. MY turned out to be his age when he died and NAME was the year he was born.
What was that year?
2 Comments
Leave one →
-
Brian Gladman permalink12345678910111213141516171819from itertools import permutations# the 16th century birth date (NAME) gives A and NA, N = 5, 1# consider possible values for the remaining letters in MY and NAMEfor E, M, Y in permutations(set(range(10)).difference([A, N]), 3):if M:# compute the numeric values of MY, NAME and DAVIDmy, name = 10 * M + Y, 1000 * N + 100 * A + 10 * M + Edavid = my * nameif 10000 < david < 100000:# extract the numeric values of the letters in DAVIDD, a, V, I, d = (int(x) for x in str(my * name))# check for consistent numeric values for the eight lettersif (a, d) == (A, D) and len({A, D, E, I, N, M, V, Y}) == 8:print(f'Born in {name}, died age {my} (DAVID = {my * name}).')
-
geoffrounce permalink123456789101112131415161718192021222324# 16th-Century ancestor gives N = 1 and A = 5 in NAMEn, a = 1, 5for m in range(1, 10):if m == a or m == n: continuefor y in range(10):if y == m or y == a or y == n: continuemy = 10 * m + yfor e in range(10):if e == y or e == m or e == a or e == n: continuename = 1000 * n + 100 * a + 10 * m + edavid = my * nameif 10000 < david < 100000:if david // 10000 != david % 10: continueif david // 1000 % 10 != 5: continueif len(set(str(david))) == 4:v, i = david // 100 % 10, david // 10 % 10if v == e or v == y or v == m or v == n or v == a: continueif i == e or i == y or i == m or i == n or i == a:continueprint('Solution: {} * {} = {}'.format(my, name, david))