Teaser 2792: Easter Teaser
From The Sunday Times, 27th March 2016 [link] [link]
I have written down three numbers and then consistently replaced digits by letters, with different letters for different digits, to give:
EASTER
SUNDAY
TEASERIn fact the first number is the lowest and one of these numbers is the sum of the other two.
What is this SUNDAY‘s number?
[teaser2792]
Jim Randell 8:56 am on 20 May 2021 Permalink |
We can get a solution using the [[
SubstitutedExpression]] solver from the enigma.py library.This run file executes in 421ms.
Solution: SUNDAY = 816270.
For a faster solution we can use the (experimental) [[
SubstitutedExpression.split_sum()]] solver.The following Python program runs in 58ms.
Run: [ @replit ]
from enigma import SubstitutedExpression, printf # solve the sum <expr> def check(expr, *extra): p = SubstitutedExpression.split_sum(expr, extra=extra, answer="SUNDAY").solver() for (s, ans) in p.solve(verbose=0): printf("SUNDAY = {ans} [{expr} / {s}]", s=p.substitute(s, expr)) # check the two possibilities check('EASTER + SUNDAY = TEASER', 'E < S') check('EASTER + TEASER = SUNDAY', 'E < T')There is only one possible solution even without the information that EASTER is the lowest number. So the [[
E < S]] and [[E < T]] clauses could be removed.LikeLike
GeoffR 9:58 am on 31 May 2021 Permalink |
LikeLike