| ← | Epochs and Eras | Calendar Page • Glossary • deutsch | Calendrical Calculator | → |
• Conversions
• Algorithms for the Jewish calendar
• Determining a Leap Year Pattern
The equations shown here may serve as a basis for programming, but can be used also to convert dates just with a calculator. Due to the choice of the Julian Date (JD) as a basis for converting calendar dates the algorithms are valid only for dates from 1 January 4713 BCE (according to the Julian calendar), this date being the epoch of the JD. In this chapter, a day is represented by the JD of that day at 12 h UT. Fractions of days, as well as the increase of the interger part of the JD at noon UT, are not considered here.
The algorithms can of course not consider actual introduction and abolition of the respective calendar.
The symbols used can be found in the following list.
| Symbol | Meaning |
|---|---|
| JD | Julian Date at 12 h UT |
| Δ | offset value |
| Nd | days elapsed since the epoch |
| N100 | number of elapsed 100-year cycles |
| R100 | number of elapsed days within the current 100-year cycle |
| L100 | length in days of a 100-year cycle |
| Nn / Rn / Ln | the same for an n-year cycle |
| NM | number of elapsed months within an adjusted year |
| D | day |
| M | month |
| Y | year |
| M' | adjusted month |
| Y' | adjusted year |
The arrangement of months and days within the Julian and Gregorian calendars puts the leap day at the end of the second month. For any calculation it would be advantageous to have the leap day at the end of the year. Therefore adjusted year and adjusted month are defined: In this adjusted mode January and February are taken to be the 13th and 14th months, respectively, of the preceeding year. The adjusted year begins thus with 1 March and ends on 28 or 29 February.
To avoid having to distinguish between different cases, the adjustment can be put into formulas. We can write
M' = ((M + 9) mod 12) + 3
Y' = Y - 1 + int((M + 7) / 10)
For example, 22 January 1905 is described by
D = 22,
M = 1,
Y = 1905,
M' = 13 ,and
Y' = 1904.
Vice versa, M and Y can be expressed by
M = ((M' + 11) mod 12) + 1
Y = Y' + int(M' / 13)
The adjusted date is employed for all calendars with the same inner structure than the Julian calendar, i. e. the same arragement of months in the year. These calendars differ only in their leap year rules. Therefore, we can use the adjusted date for the Julian and Gregorian calendars, as well as for the New Julian calendar and J H Mädler's proposed calendar.
The leap year rules of most calendars are based on cycles with certain lengths. The smallest unit we consider is the calendar year which can be either a common or a leap year. Mostly the latter is one day longer than the former.
A cycle shall be a certain sequence of common and leap years that cannot be further subdivided into equal cycles. One could define an 8-year cycle of three common years, followed by a leap year, that is again followed by three common years and concluded by a leap year. This cycle can obviously be represented by two cycles of three common years and a concluding leap year. The largest cycle of a calendar we will call main cycle.
The definition can be expanded in a way that a cycle cannot only consist of a sequence of calendar years but a sequence of equal subcycles followed by a final cycle that is different from the preceding subcycles. The 100-year cycle of the Gregorian calendar my serve as an example: It consists of 24 subcycles of three common years and one leap year each and a final cycle of four common years. The rule that every century year not divisible by 400 is a common year instead of a leap year leads to this arrangement of four-year-subcycles within the 100-year cycle.
The (sub-)cycles are defined in a way that a leap day always occurs on the very end of the cycle. The adjusted date is also defined to show this property, since it begins with 1 March and ends with 28 February or, in case of a leap year, 29 February.
We can now define the character of a cycle. The character shall be determined by the length of the last subcycle. As seen above, this subcycle is different from the preceding ones: If it is longer, the cycle whose last subcycle we are looking at is called a perfect cycle. A cycle with a concluding subcycle shorter than the preceding subcycles is a defective cycle.
Example 1: The 4-year cycle of the Julian and Gregorian calendars is a perfect cycle since the first three years
have 365 days each, while the last (leap) year has 366 days and is thus one day longer.
Example 2: The Gregorian calendar's 100-year cycle consists of subcycles of three common years and one leap year. The concluding
four year cycle is formed by four common years and is therefore shorter than the preceding cycles. Thus, the 100-year cycle is defective.
For a calendar with a main cycle of n years we first determine the start of one such cycle. This is done by adding an offset value Δ to the JD. (For convenience we will choose the last cycle that began before the JD epoch.) Thus we compute
Nd = JD + Δ.
Now that we have a count beginning with a calendar main cycle we divide this count by the cycle length Ln (n indicating the length in years of the main cycle) and get Nn, the number of cycles elapsed since the epoch. That is
Nn = int(Nd / Ln)
Now the number of days elapsed in the current main cycle is determined by computing the remainder Rn of the division of Nd by the cycle length, i. e.
Rn = Nd mod Ln.
Rn is dealt with in the same manner. Special attention must however be given to perfect cycles. For a perfect cycle of x subcycles of m years each, computing
int(Rn / Lm)
from the last day of that cycle would yield x. This last day, which is the leap day at the end of the perfect cycle, would then be considered the first day of a (x+1)th subcycle.
To avoid this, one could take the minimum of x and the result of the division int(Rn / Lm) or calculate int(Rn / Lm) - int(Rn / Ln). Thus
Nm = min(x, int(Rn / Lm)) = int(Rn / Lm) - int(Rn / Ln).
For the same reason, computing the number of elapsed days within the current cycle (Rm) cannot be done by just determining the division remainder. Instead, we simply subtract the number of days elapsed within the current cycle up to the beginning of the current subcycle from Rn. Thus
Rm = Rn - Nm · Lm.
This procedure is employed until we come down to N1 and R1. For determining the date within a year of a certain calendar the inner structure must by analysed and put into formulas, as was shown for the Gregorian calendar above.
For that, the procedure described above can "simply" be reverted. First, the number of the day within the current year is determined, then the year number is adjusted so as to gain a year count beginning with a main cycle of the calendar. This year count is then (integer) divided by the lengths of the subcycle. The remainder of that division is again divided by the length of the sub-subcycles and so forth. The result are the numbers of elapsed main cycles, subcycles, and sub-subcycles which are then multiplied with their lengths in days and the sum of these products adjusted to make up for the adjustment of the year number in the beginning.
The Gregorian calendar has a perfect 400-year main cycle. This consists of defective 100-year subcycles (plus one day), each of which is formed by 25 perfect 4-year sub-subcycles (minus one day). The cycle lengths are
L4 = 3 · 365 + 366 = 1461 days,
L100 = 25 · 1461 − 1 = 36524 days, and
L400 = 4 · 36524 + 1 = 146097 days.
One of the 400-year cycles of the Gregorian calendar with respect to the adjusted designation of months and years began on 1 March 1600 CE.
For the calculation of Δ, an epoch for counting Nd must be determined. This epoch should lie before the beginning of the JD to make the algorithm valid for the whole period covered by the JD. The JD starts in 4713 BCE of the Julian calendar, i. e. the year -4712. To determine the number of 400-year cycles we need to go backward to come to a point before -4712, and we compute
(1600 − (-4712))/400 = 15,78,
that means the epoch is
16 · 400 years = 16 · 146097 = 2337552 days
before 1 March 1600. The JD of 1 March 1600 is 2305508.
Thus, the offset value Δ is
Δ = 2337552 − 2305508 = 32044.
In the following formulas, R1 is the number of days elapsed in the current year. From this number, the number of the month (NM) and eventually the number of the day are determined. To derive a formula for calculating NM, R1 was divided by the mean month length. By some try-and-error a formula was found empirically.
The result of all this are the following equations.
Nd = JD + 32044
N400 = int(Nd / 146097)
R400 = Nd mod 146097
N100 = min(3 ; int(R400 / 36524))
R100 = R400 - 36524 · N100
N4 = int(R100 / 1461)
R4 = R100 mod 1461
N1 = min(3 ; int(R4 / 365))
R1 = R4 - 365 · N1
NM = int((111 · R1 + 41) / 3395)
D = R1 - 30 · NM - int((7 · (NM + 1)) / 12) + 1
M' = NM + 3
Y' = 400 · N400 + 100 · N100 + 4 · N4 + N1 - 4800
M = ((M' + 11) mod 12) + 1
Y = Y' + int(M' / 13)
The determination of the minimum of two numbers can be put in a more formal way. The formulas for N100 and N1 can be substituted by (see above)
N100 = int(R400 / 36524) - int(R400 / 146096)
N1 = int(R4 / 365) - int(R4 / 1460)
Which Gregorian date corresponds to JD 2354057?
JD = 2354057
Nd = JD + 32044 = 2386101
N400 = int(Nd / 146097) = 16
R400 = Nd mod 146097 = 48549
N100 = min(3 ; int(R400 / 36524)) = 1
R100 = R400 - 36524N100 = 12025
N4 = int(R100 / 1461) = 8
R4 = R100 mod 1461 = 337
N1 = min(3 ; int(R4 / 365)) = 0
R1 = R4 - 365N1 = 337
NM = int((111R1 + 41) / 3395) = 11
T = R1 - 30NM - int((7(NM + 1)) / 12) + 1 = 1
M' = NM + 3 = 14
Y' = 400N400 + 100N100 + 4N4 + N1 - 4800 = 1732
M = ((14 + 11) mod 12) + 1 = 2
J = 1732 + int(14 / 13) = 1733
The Gregorian date is 1 February 1733.
The year number is increased by 4800 and then the numbers of elapsed 400-year, 100-year, and 4-year cycles are computed. These numbers are then multiplied with the lengths of the respective cycles in days. From day and month the number of the day within the current year is calculated. Due to the adjusted month and year numbering the epoch is 2 December 4802 BCE (Gregorian). Because of that, the offset value is higher than the one used in the formulas used for computing a Gregorian calendar date from a JD. The formulas are
N100 = int((Y' + 4800) / 100)
R100 = (Y' + 4800) mod 100
JD = 146097 · int(N100 / 4) + 36524 · (N100 mod 4) + 1461 · int(R100 / 4) + 365 · (R100 mod 4) + int((7 · (M' - 2)) / 12) + 30 · M' + D − 32135
The formulas can be derived in a similar way to that of the Gregorian calender formulas.
Nd = JD + 32082
N4 = int(Nd / 1461)
R4 = Nd mod 1461
N1 = min(3 ; int(R4 / 365))
R1 = R4 - 365 · N1
NM = int((111 · R1 + 41) / 3395)
D = R1 - 30 · NM - int((7 · (NM + 1)) / 12) + 1
M' = NM + 3
Y' = 4 · N4 + N1 - 4800
M = ((M' + 11) mod 12) + 1
Y = Y' + int(M' / 13)
The formula can be derived similar to that of the Gregorian Calendar.
JD = 1461 · int((Y' + 4800) / 4) + 365 · ((Y' + 4800) mod 4) + int((7 · (M' - 2)) / 12) + 30 · M' + D - 32173
The Revolutionary calendar was in use in France from 1793 until 31 December 1805 and can be treated similarly to the Gregorian or Julian calendar. We can use the fact, that in the period the calendar was used officially, every fourth year was a leap year. In addition, getting the number of month and day from the number of the day within the year is much easier than in the Gregorian or Julian calendar, because of the constant lengths of months and the leap day being added at the end of the year.
We let the first 4-year cycle begin on 22 September 1791, which corresponds to 1 Vendémiaire 0 in theory. With this, the 3rd, 7th, and 11th year of the Republic become leap years. Clearly then
Δ = - 2375475,
which is the negative JD of 21 September 1791. As above, Δ is added to the given JD to get Nd. After that, the number of elapsed 4 year cycles (N4) and years of the current 4 year cycle (R4) are calculated.
The following formulas may serve to convert a given JD into its corresponding date of the French Revolutionary calendar. Y is the number of the year of the Republic, M the number of the month, and D the day of the French Revolutionary calendar date. Note, that the month Vendémiaire bears number 1, Brumaire is number 2, until Fructidor (12). The jours complémentaires are treated as a defective 13th month.
Nd = JD - 2375475
N4 = int(Nd / 1461)
R4 = Nd mod 1461
N1 = min(3 ; int(R4 / 365))
R1 = R4 - 365 · N1
D = (R1 mod 30) + 1
M = int(R1 / 30) + 1
Y = 4N4 + N1
The formulas can only be applied to dates from 22 September 1792 until 22 September 1806.
This formula is developed in the same way as shown for the conversion of a Gregorian date into the JD. see above). As already mentioned Y is the number of the year of the Republic, M the number of the month, and D the day of the French Revolutionary date.
JD = 1461 · int(Y / 4) + 365 · (Y mod 4) + 30 · M + D + 2375444
This formula, too, can only be applied to dates from 22 September 1792 until 22 September 1806.
This calendar has a defective 128-year main cycle consisting of perfect four-year subcycles. One 128-year cycle has 46751 days, a four-year cycle, as in the Gregorian and Julian calendars, has 1461 days. According to Mädler's proposal, a 128-year cycle was to start in 1901, and since we use adjusted years we begin such a cycle on 1 March 1901.
The determination of Δ is as follows:
1900 − (-4712) = 6612,
int(6612 / 128) + 1 = 52
52 · 46751 = 2431052, i. e. 52 · 128 = 6656 of this calendar's years.
The JD of 1 March 1900 is 2415080, and thus
Δ = 2431052 − 2415080 = 15972. (The epoch would have been 1 March 4757 BCE according to this calendar.)
The formulas are
Nd = JD + 15972
N128 = int(Nd / 46751)
R128 = Nd mod 46751
N4 = int(R128 / 1461)
R4 = R128 mod 1461
N1 = min(3 ; int(R4 / 365))
R1 = R4 - 365 · N1
NM = int((111 · R1 + 41) / 3395)
D = R1 - 30 · NM - int((7 · (NM + 1)) / 12) + 1
M' = NM + 3
Y' = 128 · N128 + 4 · N4 + N1 - 4756
M = ((M' + 11) mod 12) + 1
Y = Y' + int(M' / 13)
The New Julian Calendar has a main cycle of 900 years. Every fourth year is a leap year except of the century years that don't leave a remainder of 200 or 600 when divided by 900. When a 900-year cycle is begun with a year divisible by 900, it has three subcycles of 200, 400, and 300 years length. The first and second cycles would conclude with leap years, the last one with a common year. Using our formulas for such a cycle structure would become quite intricate. Fortunately a close look at this arrangement shows, that the beginning of a main cycle can be shifted 300 years back (or 600 years forward) which makes the 900-year cycle consist of two perfect subcycles of 500 and 400 years. The subcycles consists of defective 100-year sub-subcycles as in the Gregorian calendar. Thus, the 500-year cycle has 5 · 36524 + 1 = 182621 days, whereas the 400-year cycle consists of 146097 days. With that shift the formulas deducted become less complicated.
With the 500-year and 400-year subcycles being perfect, their different lengths need to be dealt with in determining the number of elapsed days within the respective cycle. The different numbers of 100-year sub-subcycles must be taken into account in the formula for N100, as can be seen there. For reasons of convenience, the subscript "500" is used for both cycles nevertheless.
We let a 900-year cycle start on 1 March 2400. The offset value Δ can now be determined:
2400 − (-4712) = 7112,
int(7112 / 900) + 1 = 8
8 · 328718 = 2629744, that are 8 · 900 = 7200 of this calendar's years.
The JD of 1 March 2400 is 2597702, and
Δ = 2629744 − 2597702 = 32042. (This epoch would have been 1 March 4801 BCE in the New Julian Calendar.)
The formulas then are as follows:
Nd = JD + 32042
N900 = int(Nd / 328718)
R900 = Nd mod 328718
N500 = int(R900 / 182621)
R500 = R900 mod 182621
N100 = min(4 − N500 ; int(R500 / 36524))
R100 = R500 - 36524 · N100
N4 = int(R100 / 1461)
R4 = R100 mod 1461
N1 = min(3 ; int(R4 / 365))
R1 = R4 - 365 · N1
NM = int((111 · R1 + 41) / 3395)
D = R1 - 30 · NM - int((7 · (NM + 1)) / 12) + 1
M' = NM + 3
Y' = 900 · N900 + 500 · N500 + 100 · N100 + 4 · N4 + N1 - 4800
M = ((M' + 11) mod 12) + 1
Y = Y' + int(M' / 13)
Unlike for the calendars treated so far, for the OF calendar there are quite simple equations to compute the JD from an OF date, which is the case for the conversion of a JD into the corresponding OF date, too. The reason for the simplicity of the formulas are the constant lengths of each Urlaubum and Streß.
F is the number of the Faul, U the number of the Urlaubum, and S the Streß of an OF date. There is, for computational purposes, a Streß 0, which is Streß 1 before OF in the real OF calendar. Thus, 11 Schlaf 26 before OF is represented by F = 11, U = 6, and S = -25.
Using the equations
F = (JD mod 26) + 1,
U = int((JD mod 234) / 26) + 1, and
S = int(JD / 234) - 10458
one can easily compute the OF date of a given JD.
The calculation in the other direction can be done with
To deal with the following algorithms, one should be familiar with the Jewish calendar. The calendar is described on the respective page (The Jewish calendar), where there is also a short reflection on the probabilities of the different exceptions. The basis of the calculations is the determination of the beginning of the Jewish (civil) year. Once we have an algorithm to find out the JD of Tishri 1 of a certain year, we can easily find out the character of that year by subtracting this JD from that of Tishri 1 of the following year. The difference gives the length of the year which determines its character. Now it is easy to find the number of a certain day within the current year and from that the month and day. Here, only the determination of the beginning of a year will be shown.
It is convenient to work with (one dimensional) array variables to handle the time notation with days, hours, and parts. It is necessary to define a multiplication of such a field with a number (i. e. the multiplication of any of the elements of the array with that number), the addition and subtraction of two of such arrays (where the respective elements must be added or aubtracted), and operators for comparing the arrays. Note the correct handling of carries that may occur during such calculations, which means that for instance a result 3 H 1091 P has to be interpreted as 4 H 11 P. To illustrate the comparison of two arrays it should only be said that 0 d 7 H 967 P is smaller than 0 d 8 H 1 P despite the last element of the first array (967) being greater than that of the second one (1). Array variables are designated by bold letters (e. g. D) in the formulas below. This makes it easy to distinguish them from simple numbers. The implementation of the calculations and operations mentioned shall be left to the reader.
The algorithm shown in the following has not been optimized in order to make it easy to understand. There are more compact possibilities (e. g. for the determination of the character of a year) as shown in the book Calendrical Calculations.
The general steps of the computations are simple to describe. First, the elapsed time since the starting point of the Jewish calendar until the beginning of the current 19-year cycle is calculated as well as the time that has passed within the current cycle until molad Tishri of the year in question. Adding both periods we get the molad Tishri, which lets us determine New Year's Day by considering the dehiyyot.
The following function deliveres the time from a (deliberately chosen, see below) start point until the beginning of the current 19-year cycle.
function elapsed_time1(YJ)
{
DZ = (6939;16;595) /* 19 years = 235 months = 6939 d 16 h 595 p */
NZ = int(YJ / 19)
elapsed_time1 = NZ · DZ
}
The time between the beginning of the current cycle and moald Tishri can be computed using the function below.
function elapsed_time2(YJ)
{
DM = (29;12;793) /* 1 molad = 29 d 12 h 793 p */
NM = int((YJ mod 19) · 12,36 + 0,77)
elapsed_time2 = NM · DM
}
The two functions above take 0 d 0 H 0 P as the starting point, the actual era of the Jewish calendar being 2d 5 H 204 P, the molad Tishri of the Jewish year 1. We use instead the molad Tishri of a year 0 (which never existed, but would have been a leap year) and, to avoid negative numbers during the calculations, move forward again another (deliberatley chosen) 500 days. Our new start point is thus 2d 5 H 204 P - 13 · (29 d 12 H 793 P) + 500 d = 118 d 7 H 695 P. The shift is corrected after the calculations by subtracting 500 days.
function molad(YJ)
{
DM = (29;12;793)
D0 = (118;7;695)
K = (-500;0;0)
D1 = elapsed_time1(YJ)
D2 = elapsed_time2(YJ)
molad = D0 + D1 + D2 + K
}
What is also needed is a function to find out whether the year YJ is a leap year or not. We just check the remainder of the division of YJ by 19.
function leap_year(YJ)
{
R = YJ mod 19
leap_year = ((R = 0) or (R = 3) or
(R = 6) or (R = 8) or
(R = 11) or (R = 14) or
(R = 17))
}
There are more elegant possibilities though.
Now we can determine New Year's Day by testing for the several dehiyyot.
function jewish_new_year(YJ)
{
M = molad(YJ)
/* get the day (without hours and khalakim) as a number */
N = M[d]
/* get the day of the week */
W1 = N mod 7;
/* separate hours and khalakim from the day (=> time)*/
MHP = M
/* now testing for the dehiyyot */
/* Yakh */
if (MHP >= (0;18;0))
{
N = N + 1
}
/* Adu; because there could have occurred a shift by Yakh, */
/* the day of the week must be re-determined */
W2 = N mod 7
if ((W2 = 1) or (W2 = 4) or (W2 = 6))
{
N = N + 1
}
/* Gatrad */
if ((not(leap_year(YJ))) and (W1 = 3) and (MHP >= (0;9;204)) and (MHP <= (0;18;0)))
{
N = N + 2
}
/* Betutakpat */
if ((leap_year(YJ - 1)) and (W1 = 2) and (MHP >= (0;15;589)) and (MHP <= (0;18;0)))
{
N = N + 1
}
jewish_new_year = N
}
The length of a tropical year, a sidereal year, or a synodic month cannot be expressed as a number of whole days. Since the use of a fraction of a day in a calendar must be ruled out for reasons of feasibility, common years and leap years with different lengths must be defined. Often the leap year has one day more than the respective common year. This is followed in the main part of this article. However, the same rules can be applied for leap years with leap months as well as will be shown here, too.
An appropriate sequence of common years and leap years can be used to get a mean length of the calendrical year close to the actual length of the tropical year (or whatever year is used as a basis for the respective calendar).
The sequence of leap years and common years is mostly arranged in such a way that it repeats after a certain number of years, a leap year cycle. In the Julian calendar, for example, this cycle has a length of four years, comprising of three common years followed by a leap year. The former have 365 days, the latter are one day longer, having 366 days. Thus we can write lCY = 365 and lLY = 366. To determine the mean length lY of a calendrical year the length of a leap year cycle is expressed first in days (lC,d) and then in years (nY) and then the former is divided by the latter. Thus we have
lY = lC,d / nY
In the Julian calendar the different values are
lCY = 365,
lLY = 366,
lC,d = 3 · 365 + 366 = 1461, and
nY = 4.
The mean length of the calendrical year is
lY = 1461/4 = 365 + 1/4 ( = 365.25).
The counter of the fractional part of that value shows the number of leap years in a leap year cycle the length of which is the denominator. Thus, the leap year pattern can be seen in the fractional part of the mean year length.
The length of a common year lCY is the integer part of the true length of the (tropical) year lTY,
lCY = int(lTY).
The fractional part of the true year length is expressed as a fraction, i. e. in the form p/q. Thus the true year length is
lTY = lCY + p0/q0.
(The designations p0 and q0 have been chosen with respect to later steps.)
The true year length can be determined with a high accuracy today. However, this value is not constant but is changing periodically as well as secularly. Periodic changes can be taken into account by using long periods for determining year lengths. Secular changes cannot be dealth with leap year cycles, though, due to the periodic character of cycles.
The further steps are illustrated using the tropical year as an example, the length of which is 365 d 5 h 48 min 46 s currently. Expressed as a fraction this is
lTY = 365 + 5/24 + 48/1440 + 46/86400 = 365 + 10463/43200,
thus
lCY = 365 and
p0/q0 = 10463/43200.
In order to find the number of years after which the difference between the lengths of a common year and a tropical year amounts to one day (and a correction can be made by inserting a leap day) the reciprocal of that difference (i. e. q0/p0) is computed,
| 1 | = | q0 | = | 43200 | = | 4 | + | 1348 |
| p0/q0 | p0 | 10463 | 10463 |
resulting in
| p0 | = | 1 | = | 1 | . | ||||
| q0 | 4 | + | 1348 | x1 | + | p1 | |||
| 10463 | q1 | ||||||||
The difference between calendar and actual year amounts to one day after 4 + 1348/10463 years. Neglecting the fractional part p1/q1 = 1348/10463 we see that every four years a leap year must be inserted to make up for that difference approximately.
This approximation yields the leap year pattern of the Julian calendar, i. e. one leap year in four years. The Julian calendar was introduced in the Roman empire under Caesar's rule and is being replaced by the Gregorian calendar since the late 16th century.
The error of such a calendrical year with respect to the tropical year is
10463/143200 - 1/4 = -337/43200 ≈ -1/128.
That means that every about 128 years the calendar shifts by one day compared to the tropical year. The date of the vernal equinox then is one day earlier. At the time the Julian calendar was introduced, it fell on 24 March. Almost four centuries later, at the time of the Council of Nicaea, it occured on 21 March. On that council the determination of the date of Easter was fixed in 325 CE, see The Calculation of Easter.
To further reduce the error, the same can be done with the remaining fraction p1/q1 = 1348/10463, thus
| q1 | = | 10463 | = | 7 | + | 1024 | , |
| p1 | 1348 | 1348 |
resulting in
| 10463 | = | 1 | = | 1 | . | ||||||||
| 43200 | 4 | + | 1 | x1 | + | 1 | |||||||
| 7 | + | 1024 | x2 | + | p2 | ||||||||
| 1348 | q2 | ||||||||||||
A more accurate approximation of the year length is found by neglecting the remaining fraction p2/q2 = 1024/1348. It is
| 1 | = | 7 | . | ||
| 4 | + | 1 | 29 | ||
| 7 | |||||
A cycle of 29 years with 7 leap years is more accurate then the first approximation (one leap year in four years) with an error of one day in about 1220 years. This pattern was never proposed or implemented in any calendar though.
The method described is the transformation of the fractional part of length of the year (i. e. p0/q0) into a continued fraction.
| p0 | = | 1 | |||||||||
| q0 | x1 | + | 1 | ||||||||
| x2 | + | 1 | |||||||||
| x3 | + | ... | 1 | ||||||||
| xi | + | pi | |||||||||
| qi | |||||||||||
This can be done in as many steps as are necessary for the required accuracy. To find the mean length of a calendrical year using the continued fraction with i steps the remaining fraction pi/qi in the "lowest" denominator is neglected and the continued fraction thus created transformed back to the "normal" fraction ni/di. Thus:
| ai | = | 1 | = | ni | |||||||
| x1 | + | 1 | di | ||||||||
| x2 | + | 1 | |||||||||
| x3 | + | ... | 1 | ||||||||
| xi | |||||||||||
The fraction ai = ni/di shows the leap year pattern. A cycle of di years must have ni leap years. The ai can be considered terms of a series with an increasing i. In order to find ai, xi must be calculated. The pi and qi are then determined to find ai+1. To find the leap year pattern from ai the chain fraction is transformed into a fraction with the counter ni and the denominator di.
Using the tropical year as an example, the determination of xi was shown above. It is the integer part of the reciprocal value of pi-1/qi-1 (that is qi-1/pi-1). Thus we can write
| xi | = | int ( | qi-1 | ) | . |
| pi-1 |
For the fractional part pi/qi it is
pi = qi-1 mod pi-1
and
qi = pi-1.
Transforming "longer" continued fractions (i. e. those with a larger i) into a fraction p/q is a bit complicated. However, recursive formulas can be found empirically, which are
ni = ni-1 · xi + ni-2
and
di = di-1 · xi + di-2.
The proof of the validity of these formulas for ni and di will be shown below.
Applying the algorithm described here on the tropical year the following table is found.
| i | xi | pi | qi | ni | di | Realisation |
|---|---|---|---|---|---|---|
| 0 | 365 | 10463 | 43200 | 0 | 1 | - |
| 1 | 4 | 1348 | 10463 | 1 | 4 | Julian calendar |
| 2 | 7 | 1027 | 1348 | 7 | 29 | - |
| 3 | 1 | 321 | 1027 | 8 | 33 | Omar Khayyam proposal (see Persian calendar) |
| 4 | 3 | 64 | 321 | 31 | 128 | Mädler proposal |
| 5 | 5 | 1 | 64 | 163 | 673 | - |
| 6 | 64 | 0 | 1 | 10463 | 43200 | - |
i = 1 results in the leap year pattern of the Julian calendar. For i = 3 we find a 33-year cycle with 8 leap years. Such a cycle was proposed by the Persian poet an astronomer Omar Khayyam in the 11th century for a calendar reform in Persia (see Persian calendar). Finally, i = 4 shows a pattern proposed by J. H. Mädler, placing 31 leap years in a cycle of 128 years (see Mädler Proposal and New Julian Calendar).
The formulas found here can be used not only for the tropical year. The free and bound lunar calendars can be treated as well.
The free lunar calendar employs a year of twelve synodic months. The length of a synodic month is 29 d 12 h 44 min 2,9 s, or
lM = 29 + 12/24 + 44/1440 + 29/864000 = 29 + 458429/864000
days. A year then has
l =12 · (29 + 458429/864000) =354 + 26429/72000
days. The table below can then be found.
| i | xi | pi | qi | ni | di | Realisation |
|---|---|---|---|---|---|---|
| 1 | 2 | 19142 | 26429 | 1 | 2 | - |
| 2 | 1 | 7287 | 19142 | 1 | 3 | - |
| 3 | 2 | 4568 | 7287 | 3 | 8 | - |
| 4 | 1 | 2719 | 4568 | 4 | 11 | - |
| 5 | 1 | 1849 | 2719 | 7 | 19 | - |
| 6 | 1 | 870 | 1849 | 11 | 30 | Islamic calendar |
| 7 | 2 | 109 | 870 | 29 | 79 | - |
| 8 | 7 | 107 | 109 | 214 | 583 | - |
| 9 | 1 | 2 | 107 | 243 | 662 | - |
| 10 | 53 | 1 | 2 | 13093 | 35669 | - |
| 11 | 2 | 0 | 1 | 26429 | 72000 | - |
i = 6 shows the leap year pattern of the Islamic calendar with 11 leap years in a cycle of 30 years.
In a bound lunar calendar the leap year has an extra leap month instead of a single leap day. So the length of the year must be expressed in lunar months and is thus
| l | = | 365 + 10463/43200 | = | 12 | + | 9396112 |
| 29 + 458429/864000 | 25514429 |
synodic months.
The algorithm results in the table below.
| i | xi | pi | qi | ni | di | Realisation |
|---|---|---|---|---|---|---|
| 1 | 2 | 6722205 | 9396112 | 1 | 2 | - |
| 2 | 1 | 2673907 | 6722205 | 1 | 3 | - |
| 3 | 2 | 1374391 | 2673907 | 3 | 8 | "Oktaeteris" |
| 4 | 1 | 1299516 | 1374391 | 4 | 11 | - |
| 5 | 1 | 74875 | 1299516 | 7 | 19 | Jewish calendar |
| 6 | 17 | 26641 | 74875 | 123 | 334 | - |
| 7 | 2 | 21593 | 26641 | 253 | 687 | - |
| ... | ||||||
Here, too, we can find a leap year pattern implemented in a calendar. The 19-year cycle with 7 leap years, named Metonic cycle, is employed in the Jewish calendar. In Greece a cycle of eight years with three leap years called "oktaeteris" was used in antiquity.
The recursive formulas for ni and di were found empirically. To proof their validity an inductive proof method is used. The continued fractions resulting from an increasing i are being treated as terms of a series.
• Statement
Every term of the series
| ai | = | 1 | = | ni | |||||||
| x1 | + | 1 | di | ||||||||
| x2 | + | 1 | |||||||||
| x3 | + | ... | 1 | ||||||||
| xi | |||||||||||
can be determined as
| ai | = | ni | = | ni-1 · xi + ni-2 | . |
| di | di-1 · xi + di-2 |
It is obvious that the formula can be applied beginning with a2 since a1 already is a fraction of the form p/q:
| a1 | = | n1 | = | 1 |
| d1 | x1 |
• Preliminary Considerations
First it is shown how the term ai+1 is formed from its preceding term ai.
ai as a continued fraction is
| ai | = | 1 | |||||||
| x1 | + | 1 | |||||||
| x2 | + | 1 | |||||||
| x3 | + | ... | 1 | ||||||
| xi | |||||||||
and ai+1 is
| ai | = | 1 | |||||||||
| x1 | + | 1 | |||||||||
| x2 | + | 1 | |||||||||
| x3 | + | ... | 1 | ||||||||
| xi | + | 1 | |||||||||
| xi+1 | |||||||||||
With x′i defined as
| x′i | = | xi | + | 1 |
| xi+1 |
it follows that
| ai+1 | = | 1 | |||||||
| x1 | + | 1 | |||||||
| x2 | + | 1 | |||||||
| x3 | + | ... | 1 | ||||||
| x′i | |||||||||
That means that ai+1 is formed by replacing xi with x′i in ai.
Deliberately (but, as will be seen later, reasonably) a term a0 is defined as
| a0 | = | n0 | = | 0 | . |
| d0 | 1 |
• Proof
With the preliminaries we can begin the proof.
→ Start: The statement is valid for the first term, here a2.
The validity can be checked by simple replacement, beginning with a2
because a1 is a "normal" fraction already.
According to the statement it is
| a2 | = | n2 | = | n1 · x2 + n0 | . |
| d2 | d1 · x2 + d2 |
Replacing and transforming yields
| a2 | = | 1 | = | 1 · x2 | = | 1 · x2 + 0 | = | n1 · x2 + n0 | , | ||
| x1 | + | 1 | x1 · x2 + 1 | x1 · x2 + 1 | d1 · x2 + d0 | ||||||
| x2 | |||||||||||
confirming the statement for i = 2.
→ Induction: with the statement valid for ai it must also be valid for ai+1.
For ai there is
| ai | = | ni | = | ni-1 · xi + ni-2 |
| di | di-1 · xi + di-2 |
As seen in the preliminary considerations, replacing xi with x′i in ai gives the term ai+1. Thus
| ai+1 | = | = | = | ni-1 · (xi + | 1 | ) + ni-2 | = | ni-1 · xi + ni-2 + | ni-1 | ||
| ni+1 | ni-1 · x′i + ni-2 | xi+1 | xi+1 | ||||||||
| di+1 | di-1 · x′i + di-2 | di-1 · (xi + | 1 | ) + di-2 | di-1 · xi + di-2 + | di-1 | |||||
| xi+1 | xi+1 |
The expression ni-1 · xi + ni-2 is exactly ni. Furthermore it is di = di-1 · xi + di-2.
| ni-1 · xi + ni-2 + | ni-1 | = | ni + | ni-1 | = | ni · xi+1 + ni-1 |
| xi+1 | xi+1 | |||||
| di-1 · xi + di-2 + | di-1 | di + | di-1 | di · xi+1 + di-1 | ||
| xi+1 | xi+1 |
With Y = i + 1 we can write
| aY | = | nY | = | nY-1 · xY + nY-2 | , QED |
| dY | dY-1 · xY + dY-2 |
The last expression is equal to the statement.
| ← | Epochs and Eras | Calendar Page • Glossary • deutsch | Calendrical Calculator | → |
http://www.ortelius.de/kalender/calc_en.php © Holger Oertel 2000-2008; last change: 1 September 2007