## Teaser 2902: Birthdays 2018

**From The Sunday Times, 6th May 2018** [link]

Several friends have birthdays on different days in 2018.

Replacing A by 1, B by 2, C by 3 … and Z by 26, each month and day can be replaced by a sequence of numbers. Every birthday is given numerically by day, date and month, as described above. For each friend, there is just one number common to each of their 3 sets of numbers. The number of friends is the largest possible.

How many friends are there and what is the largest number of clear days between consecutive birthdays?

[teaser2902]

## Jim Randell 12:45 pm

on1 July 2019 Permalink |The puzzle text is not completely clear, and allows several interpretations.

I interpreted it as follows:

A date, such as Friday 25th May 2018, is translated into a sequence of numbers as follows:

The “day of month” always provides a sequence with a single number in it, and this number must also appear in the “day name” sequence and the “month name” sequence (which are created by translating the letters to numbers). Furthermore it must be the only number that is shared between the translated sequences.

In the example 25=Y occurs in FRIDAY and also in MAY, but it is not the only letter in common A=1 also occurs.

Using this interpretation we find there are only four dates that meet the requirements. And we then look for the longest gap between consecutive dates in this set.

This Python program runs in 83ms.

Run:[ @repl.it ]Solution:There are 4 friends. The longest gap between consecutive dates is 81 days.The 4 dates are:

The longest gap between these dates is 81 non-birthday days between [3] and [4].

However, if we’re looking at “the maximum number of consecutive non-birthday days in 2018” there is a longer run from 1st January to 31st March, which is 90 days. (The run from 16th October to 31st December is 77 days).

And the puzzle just asks for the longest gap between birthdays, and once we have fixed the dates we can see that the gap between birthday [4] and the next occurrence of birthday [1] (in 2019) is 167 days, and this gap would be 1 day longer if a leap year is involved. So the longest possible gap between birthdays is 168 days.

LikeLike