The Gregorian calendar is the calendar used for civil dates in most of the world. Its rule for leap years makes the calendar repeat every 400 years. The U.S. Naval Observatory's calendar chapter gives that cycle as 146,097 days, or 365.2425 days per year, close to the length of the tropical year.
Formula
mean year = (303 × 365 + 97 × 366) ÷ 400 = 365.2425 days
A 400-year cycle has 97 leap years and 303 common years.
Example
The cycle length is 303 × 365 + 97 × 366 = 146,097 days. Since 146,097 = 20,871 × 7, a whole number of weeks, weekdays repeat exactly every 400 years. The mean year is 365.2425 ÷ 7 = 52.1775 weeks (how many weeks in a year).