Here is a good explenation of it.
The trick here is to figure out which months start on the same day of
the week. In a standard (non-leap) year, if January starts on a
Monday, then February starts on a Thursday, March also starts on a
Since January has 31 days, it has 4 full weeks (28 days) plus 3 days.
Hence, February must start 3 weekdays later. Similarly, since February
has 28 days (4 weeks + 0 days,) March starts on the same weekday as
February. Continuing this pattern, you can see which months start on
the same days, and you can count how many months start on each day.
Remember to do the counts for both a standard year and a leap year!
If months (like February and March) start on the same weekday,
logically the 13th of those months will also fall on the same weekday
- which will, in certain years be a Friday. So whatever was the
highest count of months starting on the same weekday, that number is
the most Friday the 13th's there could possibly be.