Teaser 3141: Multiple extensions
From The Sunday Times, 4th December 2022 [link] [link]
All the phone extensions at Mick’s work place are four-digit numbers with no zeros or twos, and no digit appears more than once in a number. He can enter all the extension numbers on the keypad by starting at key 2 (but not pressing it) then moving in any direction, including diagonally, to an adjacent key and pressing it; then similarly moving to and pressing adjacent keys until the number is entered. A couple of examples of his extension numbers are 3685 and 5148.
He phoned two different extension numbers this morning and later realised that one was an exact multiple of the other.
What was the larger extension number he dialled?
[teaser3141]
Jim Randell 4:54 pm on 2 December 2022 Permalink |
The following Python program runs in 58ms. (Internal run time is 6.2ms).
Run: [ @replit ]
(Or a more efficient (but longer) variation on this code [@replit]).
Solution: The larger number was: 4758.
And the smaller number was: 1586.
LikeLike