Metonic cycle
The Metonic cycle or enneadecaeteris (from Ancient Greek: ἐννεακαιδεκαετηρίς, from ἐννεακαίδεκα, "nineteen") is a period of almost exactly 19 years after which the lunar phases recur at the same time of the year. The recurrence is not perfect, and by precise observation the Metonic cycle defined as 235 synodic months is just 2 hours, 4 minutes and 58 seconds longer than 19 tropical years. Meton of Athens, in the 5th century BC, judged the cycle to be a whole number of days, 6,940.[3] Using these whole numbers facilitates the construction of a lunisolar calendar.
A tropical year (about 365.24 days) is longer than 12 lunar months (about 354.36 days) and shorter than 13 of them (about 383.90 days). In a Metonic calendar (a type of lunisolar calendar), there are twelve years of 12 lunar months and seven years of 13 lunar months.
The Metonic cycle is the most accurate cycle of time (in a timespan of less than 100 years) for synchronizing the tropical year and the lunar month (synodic month), when the method of synchronizing is the intercalation of a thirteenth lunar month in a calendar year from time to time.[17] The traditional lunar year of 12 synodic months is about 354 days, approximately eleven days short of the solar year. Thus, every 2 to 3 years there is a discrepancy of 22 to 33 days, or a full synodic month. For example, if it happened some day that the winter solstice and a new moon coincided, it would take 19 tropical years for the coincidence to recur. The mathematical logic is this:
That duration is almost the same as 235 synodic months:
Thus the algorithm is correct to 0.087 days (2 hours, 5 minutes and 16 seconds).
For a lunisolar calendar to 'catch up' to this discrepancy and thus maintain seasonal consistency, seven intercalary months are added (one at a time), at intervals of every 2–3 years during the course of 19 solar years. Thus twelve of those years have 12 lunar months and seven have 13 months.