Sunday Times Teaser 2493 – No Title
by H Bradley and C Higgins
Published July 4 2010 (link)
Pat won the driving competition. The course was a whole number of miles long and he completed the course in a whole number of minutes (less than two hours). His speed was a two-figure number of miles per hour. The time taken to complete the course was 17 minutes less than the time he would have taken to drive 17 miles less than the distance he would have gone if he had driven for 17 minutes less than the time he would have taken to complete the course at two-thirds of his speed.
How long was the course?
One Comment
Leave one →
-
Brian Gladman permalink123456789101112131415161718192021222324from number_theory import divisors# if the speed is S miles per hour and the time for the# journey is T, the sequence described becomes:## T = [(3.T / 2 - 17) / (S / 60) - 17] / (S / 60) - 17## This can be simplified to give:## S.(T - 68) = 2040# the speed S is a divisor of 2040for S in divisors(2040):# calculate the timeT = 68 + 2040 // S# and the length of the course (S / 60).TL, r = divmod(S * T, 60)# the course length (L) is an integer number of miles,# the speed (S) is a two digit value and the time (T)# is less than 2 hoursif not r and 10 <= S < 100 and T < 120:print(f'The course was {L} miles ({T} minutes at {S} mph).')