eric-kaiser.net

Leap Years and Friday 13s

December 24, 2017

With 2018 close to around the corner, there's a lot of the usual talk about the new year and its properties (it's nice how it starts on a Monday, for instance), and it reminded me of a little fact I once heard: every year, there'll be at least one Friday 13.

It kind of surprised me back then because that seems like a lot — I'm not superstitious, but those who are would never get a break. It also got me wondering how you could be sure of that fact, and how you would even begin to prove it. Turns out, though, that it's a simple proof by exhaustion — there's only so many "types" of year. In fact, a year has only two determining factors:

  • on which day does it start?
  • is it a leap year or not?

There's no need to consider all the days of the year and ask which weekday they'll be, since they all (very straightforwardly) depend on what the first day of the year is. The pattern of weekdays is very predictable (as it should be), so if you describe the first day, the rest will follow.

...except, of course, leap years, which change the number of days in a year and thus their mapping to weekdays after February 28th. So leap year status is another factor to take into account.

Together they uniquely determine a year, and that amounts to 14 different "types" of year. (I'll be calling them configurations here, but another fitting term might be weekday distributions.)

From there all you need to do is fourteen manual checks (or quickly put together a program to do it). And sure enough, in all configurations there's a Friday 13! Here's a handy table, sorted by order of a configuration's occurrence since 1970:

Configuration Months with a Friday 13
First weekday Leap year?
Thursday February, March, November
Friday August
Saturday October
Monday April, July
Tuesday September, December
Wednesday June
Thursday February, August
Saturday May
Sunday January, October
Tuesday June
Sunday January, April, July
Friday May
Wednesday March, November
Monday September, December

Sucks to be superstitious indeed.

Years you've never lived through

Thinking a little more about configurations, it makes me wonder if I (born in 1993) have lived through all of them yet. Let's have a look at all the years from 1970 to 2038! (The range kind of gives away how, and perhaps how sloppily, the table was put together.)

Configuration Years
First weekday Leap year?
Thursday 1970, 1981, 1987, 1998, 2009, 2015, 2026, 2037
Friday 1971, 1982, 1993, 1999, 2010, 2021, 2027, 2038
Saturday 1972, 2000, 2028
Monday 1973, 1979, 1990, 2001, 2007, 2018, 2029, 2035
Tuesday 1974, 1985, 1991, 2002, 2013, 2019, 2030
Wednesday 1975, 1986, 1997, 2003, 2014, 2025, 2031
Thursday 1976, 2004, 2032
Saturday 1977, 1983, 1994, 2005, 2011, 2022, 2033
Sunday 1978, 1989, 1995, 2006, 2017, 2023, 2034
Tuesday 1980, 2008, 2036
Sunday 1984, 2012
Friday 1988, 2016
Wednesday 1992, 2020
Monday 1996, 2024

Turns out I'm still missing one configuration! I've never had a leap year starting on a Wednesday. All other configurations have since happened. The last year of this kind was 1992 — those who were alive then have seen it all, with no year configurations for them to explore. I'll have to wait for a Wednesday leap year until 2020. I'm sure that'll be an exciting time!

F13 months come in pairs

Back to Friday 13s. ...Friday the 13s? Fridays the 13th? ...let me just call them F13s for short.

Every configuration has at least one F13 month — that's the translation of the fact I mentioned earlier to our new terminology, and it's pretty obvious from the first table. What's also interesting, looking at it again, is that every month occurs exactly twice. I'm not sure if that's a coincidence: is there a deeper reason that every month must occur, and that it can't occur more than twice? However, it's pretty easy to see that if a month occurs, it must occur at least twice.

For that, let's distinguish between pre-February months (whose configurations don't depend on whether it's a leap year) and post-February months (whose configurations do). February is thus a pre-February month.

For a pre-February month, if it has an F13 in a non-leap-year, it also has one in a leap year starting on the same day. (Leap year status has no effect on the month, so all that matters is the year's first weekday, and there are always two such years.) For a post-February month, if it has an F13 in a non-leap year, it also has one in a leap year starting a day earlier (the leap day cancels out the "a day earlier", so F13 falls on the same day.)

Q.E.D., maybe? That's pretty much all I managed to "prove", and even them I'm sure it's not rigorous.

Much ado about nothing

Now, all this is definitely nothing new — it's certainly been thought of and explained many times before, and probably in a less convoluted way too.

Still, it's great fun just to play around with something, with no goal in mind but the joy of finding patterns. The calendar is a very rewarding system to play with in that sense: it feels really math-y but isn't too hard or abstract, and you can get pretty far with basic reasoning and feel like a genius afterwards. You could probably think of the calendar as some algebraic structure or something, I don't know. If there's someone who read through all of this, thanks for humoring me!

While this must have made me look like a calendar nerd, I'm not actually that experienced with it. For instance, if you name some random day of some random year, I can't calculate which weekday that is. There's a handful of algorithms you can memorize, so maybe I'll get around to that some day — though I can't say what weekday.


And so I'm offering this simple fact
to the year nineteen-ninety-two —
Although it's been thought many times, many ways,
Wednesday leap year, that's you