Brain-Teaser 38: Digital computer
From The Sunday Times, 10th December 1961 [link]
My nephew Gregory is keen on calendars — an odd interest for a bank clerk.
“On my next birthday”, he told me yesterday, “I shall take the day off work to celebrate”.
“To celebrate what?” I asked.
“To celebrate the fact that it will be the same day of the week as that on which I was born. Moreover, the sum of the digits in the date (e.g. 26/11/1961 = 27) will equal my age, as would also have been the case if had been born just four weeks later than I was”.
What was Gregory’s date of birth?
[teaser38]



Jim Randell 11:23 am on 4 July 2021 Permalink |
This Python program runs in 54ms.
Run: [ @replit ]
from datetime import date, timedelta from enigma import dsum, printf # digit sum of a date ddsum = lambda d: dsum(d.day) + dsum(d.month) + dsum(d.year) # generate dates in a specific range inc1 = timedelta(days=1) def drange(a, b, step=inc1): while not(a > b): yield a a += step # consider date of next birthday (within 1 year of the puzzle date) for d in drange(date(1961, 12, 10), date(1962, 12, 9)): w = d.weekday() # must be a workday if w == 6: continue # calculate digit sum (= age) n = ddsum(d) # and calculate the date n years ago b = date(d.year - n, d.month, d.day) # do days of the week match? if b.weekday() == w: # if the birthday was 28 days later ... b_ = b + 28 * inc1 # the digit sum of the nth birthday is also n if ddsum(date(b_.year + n, b_.month, b_.day)) == n: printf("{d} ({n}) -> born = {b} (+4w = {b_})")Solution: Gregory was born on Friday, 2nd February 1940.
So:
There is a second candidate solution:
But this is eliminated as his next birthday is on a Sunday, so he wouldn’t have to take the day off work.
LikeLike
Jim Olson 9:41 pm on 6 July 2021 Permalink |
Four weeks after 2/22/1940 would have been 3/21/1940.
LikeLike
Jim Randell 9:51 pm on 6 July 2021 Permalink |
But if he was born on 22nd February 1940 his next birthday in 1962 would be his 22nd, but the sum of the digits in the date (22/2/1962) would be 24, so it doesn’t work.
LikeLike
Jim Olson 10:06 pm on 6 July 2021 Permalink |
I think the wording of this Teaser through me off. I see that the 3/21/1962 digits don’t total 22 and that was my problem. 3/1/1940 is not four weeks after his birth. So I didn’t see how this satisfied the requirements of the teaser.
LikeLike
Jim Randell 10:40 pm on 6 July 2021 Permalink |
1st March 1940 is exactly 4 weeks after 2nd February 1962 because 1940 was a leap year. So the month number goes up 1 and the day number goes down 1, keeping the sum of the digits the same. (Of course the fact that 1962 is not a leap year means that if he had been born 4 weeks later, his next birthday would not be on the same day of the week as the day he was born. But the sum of the digits in the date would be the same as his age, and that is what is important).
LikeLike
Jim Olson 11:50 pm on 6 July 2021 Permalink |
Apologies I must of misread the posting of the answer as 2/22/1940.
LikeLike