## Teaser 2837: Back and forth

**From The Sunday Times, 5th February 2017** [link]

George and Martha have a digital 24-hour clock that always displays the time as four digits (e.g. 2:17am displays as 0217). During one lazy weekend George noted two particular times when the four-digit display was palindromic. He calculated the number of minutes from the first of these times to the second and he discovered that the answer was a three-figure palindrome. When he reported all the details to Martha, she commented that the sum of the eleven digits in the three palindromes was also palindromic.

What were the two palindromic times?

[teaser2837]

## Jim Randell 8:19 am

on7 October 2019 Permalink |This program considers when there is a corresponding minute for each hour to make a list of palindromic times, and then looks at pairs of times from this list that satisfy the remaining conditions.

It runs in 44ms.

Run:[ @repl.it ]Solution:The two times were 1001 and 0110 (the following day).The first time is 10:01am on one day (displayed as 1001), the second time is 1:10am the following day (displayed as 0110). The difference between these times is 15 hours and 9 minutes = 909 minutes. And the sum of the digits in 1001, 0110, 909 is 22.

LikeLike