February sometimes has an unusually appealing shape in the calendar. For example, in February 2021 you could experience such a moment, a "perfectly rectangular February". This rare effect occurs when February has exactly \(28\) days and February 1 falls on a Monday. But how often does this actually happen and how long do you have to wait for the next time?

For February to appear "perfectly rectangular", two conditions must be met:

- It must be a non-leap year so that February has exactly \(28\) days,
- February 1 must fall on a Monday.

If both conditions are met, February fits exactly into a \(4x7\) grid in the calendar without days from other months appearing in the same week:

In the Gregorian calendar, there are therefore \(14\) possible calendar types: seven for non-leap years(\(365\) days), in which January 1st falls on a different day of the week, and seven for leap years(\(366\) days), in which January 1st also falls on a different day of the week.

Suppose we call the calendar with \(365\) days where January 1st falls on a Monday \(A\). The calendar where the year starts on a Tuesday is \(B\), the one on a Wednesday \(C\), and so on until \(G\). Then we call the \(366\) day calendars where January 1st falls on a Monday \(1\), the one on a Tuesday \(2\), and so on. This results in the following 14 different calendars:

**365 days:**\(A, B, C, D, E, F, G\)**366 days (leap years):**\(1, 2, 3, 4, 5, 6, 7\)

Now January always has \(31\) days, and we want February to start on a Monday. This means that January 31 must fall on a Sunday. If January 24, 17, 10 and 3 are Sundays, then January 1 falls on a Friday. So we are looking for the calendar \(E\). Calendar \(5\) cannot be used because these are leap years in which February has \(29\) days.

The calendar follows a \(400\)-year cycle. In this cycle, there are \(97\) leap years, and the cycle comprises a total of \(146,097\) days. After that, the cycle starts all over again. In the year \(2001\), a new cycle began, and January 1 fell on a Monday. In a regular \(365\)-day year, the new year always begins on the next weekday compared to the previous year. After a leap year, however, the new year begins two days later. Thus, January 1, 2001 was a Monday, 2002 a Tuesday, 2003 a Wednesday, 2004 a Thursday and 2005 a Saturday. There are no leap years in century years, unless the century year is divisible by \(400\).

The calendar sequence over a \(400\)-year cycle is as follows:

$$\displaylines{ABC4 \,\, FGA2 \,\, DEF7 \,\, BCD5 \,\, GAB3\\

EFG1 \,\, CDE6 \,\, ABC4 \,\, FGA2 \,\, DEF7\\

BCD5 \,\, GAB3 \,\, EFG1 \,\, CDE6 \,\, ABC4\\

FGA2 \,\, DEF7 \,\, BCD5 \,\, GAB3 \,\, EFG1\\

CDE6 \,\, ABC4 \,\, FGA2 \,\, DEF7 \,\, BCDE\\

FGA2 \,\, DEF7 \,\, BCD5 \,\, GAB3 \,\, EFG1\\

CDE6 \,\, ABC4 \,\, FGA2 \,\, DEF7 \,\, BCD5\\

GAB3 \,\, EFG1 \,\, CDE6 \,\, ABC4 \,\, FGA2\\

DEF7 \,\, BCD5 \,\, GAB3 \,\, EFG1 \,\, CDE6\\

ABC4 \,\, FGA2 \,\, DEF7 \,\, BCD5 \,\, GABC\\

DEF7 \,\, BCD5 \,\, GAB3 \,\, EFG1 \,\, CDE6\\

ABC4 \,\, FGA2 \,\, DEF7 \,\, BCD5 \,\, GAB3\\

EFG1 \,\, CDE6 \,\, ABC4 \,\, FGA2 \,\, DEF7\\

BCD5 \,\, GAB3 \,\, EFG1 \,\, CDE6 \,\, ABC4\\

FGA2 \,\, DEF7 \,\, BCD5 \,\, GAB3 \,\, EFGA\\

BCD5 \,\, GAB3 \,\, EFG1 \,\, CDE6 \,\, ABC4\\

FGA2 \,\, DEF7 \,\, BCD5 \,\, GAB3 \,\, EFG1\\

CDE6 \,\, ABC4 \,\, FGA2 \,\, DEF7 \,\, BCD5\\

GAB3 \,\, EFG1 \,\, CDE6 \,\, ABC4 \,\, FGA2\\

DEF7 \,\, BCD5 \,\, GAB3 \,\, EFG1 \,\, CDE6}$$

Now we just have to count how often the calendar \(E\) occurs in this sequence. There are \(43\) occurrences:

$$\frac{43}{400} = \frac{10,75}{100} = 10,75\%$$

A perfectly rectangular February is a rare calendar phenomenon that only occurs about once every ten years, so the next time you see a calendar with a perfectly rectangular February, know that you are witnessing a rare and beautiful moment that only occurs about once every ten years. The next time, by the way, will be in February 2027.