Brain-Teaser 36: [Telephone numbers]
From The Sunday Times, 26th November 1961 [link]
On one of June’s birthdays her father telephoned some of her friends inviting them to June’s party. He noticed that Joan’s telephone number consisted of the four digits in his own, but in reverse order, and that one phone number divided by the other gave June’s age.
On a subsequent birthday June rang up Jennifer from a call box and she also noticed that Jennifer’s number and that of the call box were four digit numbers, each the reverse of the other. Dividing these two numbers gave June’s latest age.
How old was June when the two phone calls were made?
This puzzle was originally published with no title.
[teaser36]
Jim Randell 9:19 am on 20 June 2021 Permalink |
The phone numbers must be different, so the ages are more than 1 (but less than 10).
We can use the [[
SubstitutedExpression]] solver from the enigma.py library to find candidate phone numbers and ages.The following run file executes in 78ms.
Run: [ @replit ]
Solution: The calls were made when June was 4 years old and 9 years old.
The two sets of numbers are:
LikeLike
Hugh Casement 2:33 pm on 20 June 2021 Permalink |
If they had been five-digit numbers we would have had
87912 / 21978 = 4
98901 / 10989 = 9
It seems we can insert a string of as many 9s in the middle of each number as we like.
LikeLike
Hugh Casement 3:08 pm on 20 June 2021 Permalink |
Over the years this has proved surprisingly popular, with slight variants.
See Enigmas 792 and 1535, Teasers 847, 1663, and 1964.
LikeLike
GeoffR 9:01 pm on 21 June 2021 Permalink |
from itertools import permutations ages = [] # list for June's ages for p1 in permutations(range(10),4): a, b, c, d = p1 if 0 in (a, d): continue abcd = 1000*a + 100*b + 10*c + d dcba = 1000*d + 100*c + 10*b + a q, r = divmod(abcd, dcba) if r == 0: ages.append(q) # two phone calls were made if len(ages) == 2: print(f"June's ages were {ages[0]} and {ages[1]} years.") # June's ages were 4 and 9 years.LikeLike