Actually, I'm wrong. It's more complicated than that.
Years are so stupid. Every year, the first day of the week goes forward 1 day. So January 1st will be a Monday, then next year a Tuesday, then next year a Wednesday and so on.
However, leap years mess this up so that the cycle jumps forward 2 days.
This means that days of the week don't loop perfectly unless they're 28 years apart.
Here's the full cycle of January 1sts, for example, with leap years in allcaps:
Monday
Tuesday
Wednesday
THURSDAY
Saturday
Sunday
Monday
TUESDAY
Thursday
Friday
Saturday
SUNDAY
Tuesday
Wednesday
Thursday
FRIDAY
Sunday
Monday
Tuesday
WEDNESDAY
Friday
Saturday
Sunday
MONDAY
Wednesday
Thursday
Friday
SATURDAY (Next year, loop back to beginning)
Thus for days of the week to line up, it has to be a multiple of 28 years in the future.
That's 28, 56, and... 84. 😮