# What is the age of the old man?

In autumn of the year 2003 an old man was asked about his age. He answered: "I was born on a Sunday morning in summer and I celebrated my seventh birthday on a Sunday morning too!"

How old was the man, when he was asked about his age in 2003?

There are a few tricksy ways to make this work (e.g. by bending semantics with a birthday on 29 February in Southern Hemisphere summertime, and claiming that 28 years later - when the Gregorian calendar usually repeats itself, with all dates falling on exactly the same days of the week - it's technically "only my seventh birthday", for instance...). However, in the absence of a tag, here's a solution that relies purely on the historical fact that:

the year 1900 was not a leap year. Because of this, the man could have been born on any Sunday in the Northern Hemisphere summer of 1896 (e.g. on Sunday 28 June 1896) or any Sunday in the Southern Hemisphere summer of 1896-7 (anywhere as late as Sunday 28 February 1897), and then 7 years later in 1903/4 he would turn 7 on exactly the same day of the week as he was born (a Sunday) since no leap days have been added to the calendar in the years he has lived through.

(NB In the intervening years he would have turned 1 on a Monday, 2 on a Tuesday, 3 on a Wednesday, 4 on a Thursday, 5 on a Friday, and 6 on a Saturday, before turning 7 on a Sunday once again, since a non-leap year of 365 days cannot be exactly divided into weeks, consisting as it does of 52 weeks and 1 additional day.)

This means that in the autumn of 2003 the old man would be:

107 years old if in the Northern Hemisphere (having already had his summer birthday that year) or 106 years old if in the Southern Hemisphere (with his 107th summer birthday yet to come) - either way, very 'old' indeed!

(Of course, the man may also have moved from one hemisphere to the other in his lifetime - but let's not go there, as it's already confusing enough as it is!)

• Regarding your preface to your answer: He might've celebrated his seventh birthday not on the birthday itself. Apr 11 at 6:02
• @msh210 Yes, that would definitely make for a very interesting puzzle. "A man was born, and had a seventh birthday. How old is he?"
– Bass
Apr 11 at 12:36
• Since no exact year can be determined, the old man could've been born as early as 1893 or as late as 1899, for an age range of 104–110.
– SQB
Apr 11 at 14:08
• @SQB But then there would be a leap year before the man's 7th birthday - either in 1896 or 1904 - which means he would turn 7 on a Monday instead...
– Stiv
Apr 11 at 16:02
• @COTO Using Southern Hemisphere geography allows for some tricksy solutions involving the man's birthday being on Feb 29, which is Southern Hemisphere summertime (the equivalent of Aug 29 in the North...). If in one leap year Feb 29 falls on a Sunday, 7 leap year cycles later it will do again, and you can start playing the semantics game and saying "It's technically only my seventh birthday...!"
– Stiv
Apr 11 at 19:23

If it weren't for leap years, the Gregorian calendar would repeat every 7 years. But due to the 4-year frequency of 29 Feb, it actually repeats every 28 years, except in some rare cases.

So the task is to find one of those rare cases: a 7-year span without a leap year.

Any 7-year span containing 1900 and not 29 Feb in either 1904 or 1896 would suffice. So being born on a Sunday in 1896 after Feb would result in turning seven on a Sunday in 1903. Being born before March in 1897 would result in turning seven in 1904 on the same weekday. Both yield the same result for the autumn of a following year: the old man was 107 years old.

I wrote a little bit of code that attempts to work this out. It searches every date from an arbitrary point in time that gives the man a chance to be up to 130 years old, and checks to see if that date and the date seven years later are both Sundays. If this check is true, it returns the date as the date of birth and calculates the age.

Paste this code into a new module in Excel VBA and run CalculateAge(). Spoiler alert: this will give you the answer (the answer is also in the spoiler block at the bottom).

Sub CalculateAge()

Dim birthDate As Date

birthDate = GetDOB()

'   The last day of autumn 2003 was 22nd December.
MsgBox "Age: " & DateDiff("yyyy", birthDate, "22-Dec-2003") & Chr(13) & "Date of Birth: " & birthDate, vbOKOnly, "Old Man's Age"

End Sub

Function GetDOB()

Dim startDate As Date
Dim loopLength As Long
loopLength = CLng(137) * 365

For i = 0 To loopLength
If Weekday(startDate + i) = 1 And Weekday(DateAdd("yyyy", 7, startDate + i)) = 1 Then GetDOB = startDate + i
Next i

End Function