Teaser 2611: Simple arithmetic
From The Sunday Times, 7th October 2012 [link] [link]
George and Martha are teaching their great-grandchildren some simple arithmetic. “If you add two thirties to four tens you get a hundred”, George was saying, and he wrote it like this:
“Strangely”, added Martha, there are nine different letters there, and if you allow each letter to stand for a different digit, there is a unique sum which works”.
Which digit would be missing?
[teaser2611]

Jim Randell 8:40 am on 10 November 2022 Permalink |
We can use the [[
SubstitutedExpression.split_sum()]] solver from the enigma.py library to solve this puzzle.The following run file executes in 58ms. (Internal runtime is 4.74ms).
Run: [ @replit ]
from enigma import (SubstitutedExpression, irange, diff, join, printf) # construct the alphametic sum p = SubstitutedExpression.split_sum( ["THIRTY"] * 2 + ["TEN"] * 4, "HUNDRED", template="(2 * {THIRTY} + 4 * {TEN} = {HUNDRED})", ) # solve the puzzle, and output unused digit(s) for s in p.solve(): ds = diff(irange(0, 9), s.values()) # output solution printf("-> unused digits = {ds}", ds=join(ds, sep=", "))Solution: The missing digit is 7.
LikeLike
GeoffR 11:40 am on 10 November 2022 Permalink |
LikeLike
GeoffR 10:25 pm on 10 November 2022 Permalink |
LikeLike