Most Weekend Birthdays

More Details

Every child wants his or her birthday to fall on a weekend. Each year, there are many lucky birth dates that maximize weekend birthdays for the following 18 years.

What Your Function Should Do

Write a function called MostWeekendBirthdays that takes a year as input. The result should be the number of lucky birth dates in that year.

MostWeekendBirthdays[2016]

MostWeekendBirthdays[2003]

MostWeekendBirthdays[1984]

More Examples

There are 96 days in 1987 that maximize the number of weekend birthdays for the next 18 years:

MostWeekendBirthdays[1987]

Here are all 96 dates:

Each birth date in this grid had exactly six weekend birthdays in the years 1988 through 2005. The weekend birthdays for January 2 happened in 1988, 1993, 1994, 1999, 2000 and 2005.

MostWeekendBirthdays[year_Integer]:=