Brainteaser 1485: Safe depository
From The Sunday Times, 24th February 1991 [link]
The number of my safe deposit box in the Norsex Bank has four different digits, decreasing from left to right. Curiously, that of my fiancée has the same figures but in the reverse order. The bank manager, Mr K. Aprekar, has said that when we are married next month, he will give us a presently-vacant box number which not only contains the four digits we now share, but is in fact the difference between our two numbers.
What is it?
[teaser1485]
Jim Randell 9:32 am on 21 September 2023 Permalink |
Here is a solution using the [[
SubstitutedExpression]] solver from the enigma.py library.The following run file executes in 71ms. (Internal runtime of the generated program is 496µs).
Run: [ @replit ]
#! python3 -m enigma -rr SubstitutedExpression # suppose the current numbers are: ABCD and DCBA # numbers are decreasing "A > B" "B > C" "C > D" # the new number (= the difference between the original two numbers) --macro="@new = ABCD - DCBA" # is composed of the same digits "set(nsplit(@new, 4)) == {A, B, C, D}" --answer="@new"Solution: The new box number is 6174.
We have:
LikeLike