Teaser 2766: Two by two
From The Sunday Times, 27th September 2015 [link] [link]
Animals board the ark in pairs.
EWE and RAM
HEN and COCKIn fact these are numbers with letters consistently replacing digits; one pair of the numbers being odd, the other pair being even, and both pairs have the same sum. The three digits of the number ARK are consecutive digits in a muddled order. All this information uniquely determines the number NOAH.
What is the number NOAH?
[teaser2766]
Jim Randell 9:10 am on 26 November 2020 Permalink |
This puzzle can be solved using the [[
SubstitutedExpression]] solver from the enigma.py library.The following run file executes in 136ms.
Run: [ @repl.it ]
Solution: NOAH = 2074.
The pairs are:
Both pairs sum to 1468.
And (A, R, K) rearranged gives the consecutive numbers (6, 7, 8).
LikeLike
Frits 10:13 am on 26 November 2020 Permalink |
Trying not to copy all Jim’s equations.
from itertools import permutations c = 1 digits = set(range(10)).difference({1}) for Q in permutations(digits): e,w,r,a,m,h,n,o,k = Q # letter combinations don't start with zero if 0 in [e, r, h, n, a]: continue # pairs EWE, RAM and HEN, COCK are even or odd if (e + m) % 2 == 1 : continue if (n + k) % 2 == 1 : continue # one pair of the numbers being odd, the other pair being even if (e + n) % 2 == 0: continue # both pairs have the same sum s1 = (e + r) * 100 + (w + a) * 10 + e + m s2 = c * 1000 + (h + o) * 100 + (e + c) * 10 + n + k if s1 != s2: continue # a,r,k are three consecutive digits in a muddled order s3 = sum(abs(x - y) for (x, y) in zip([a, r, k, a], [r, k, a])) if s3 != 4: continue print(f"NOAH = {n}{o}{a}{h}")LikeLike
GeoffR 12:24 pm on 26 November 2020 Permalink |
LikeLike