The Algorithm of D.A.Hatcher The algorithms discussed below were originally described by D.A.Hatcher in 1984 (references 1 and 2). They were discussed at greater length in Mapping Time (reference 4). Some features of the description in Mapping Time have been considered too succinct and not always with sufficient clarity. D.A.Hatcher's algorithms provided an algorithm for converting dates in a wide variety of calendars, regular calendars, into day numbers, and vice versa. Note that not all calendars are regular calendars, the Jewish and Mayan calendars in particular are excluded. Below, we present an extended treatment of the arguments given in Chapters 24 and 25 of Mapping Time. Proofs are provided of all relevant formulae. It is my intention that they should be readily comprehensible to readers with little mathematical expertise and the mathematical arguments are deployed in great detail; what is obvious to some is puzzling to others and it is hoped that readers with more mathematical experience will forgive what they may consider to be tedious detail. There is no guarantee that the proofs and derivations described are the shortest possible. If you come up with shorter or better ones, please E-mail me with them. Likewise contact me if you find any errors or obscurities. References 1. Simple Formulae for Julian Day Numbers and Calendar Dates D.A.Hatcher Quarterly Journal of the Royal Astronomical Society (1984) 25,53-55 2. Generalised Equations for Julian Day Numbers and Calendar Dates D.A.Hatcher Quarterly Journal of the Royal Astronomical Society (1985) 26,151-155 3. Additif to the Paper of D.A.Hatcher: Generalised Equations for Julian Day Numbers and Calendar Dates J.P.Parisot Quarterly Journal of the Royal Astronomical Society (1986) 27, 506-507 4. Mapping Time E.G.Richards Oxford University Press 1998, 1999 Contents -------- Part 1 Mathematical notes A. Some properties of integer division and the MOD function Part 2 Regular calendars B. Introduction C. Intercalation Cycles D. The Computational calendar (CC) E. Outline of the Algorithm F. The interconversion of D'/M/'Y' (CC) and D/M/Y (X) G. The conversion of dates (D'/M'/Y') to day numbers (J) H. The conversion of day numbers (J) to dates (D'/M'/Y') I. The Epoch of the computational calendar J. The complete algorithm for converting D/M/Y to J K. The complete algorithm for converting J to D/M/Y L. The parameters of regular calendars M. Setting up a new regular calendar, X Part 3 Some calendars N. Seventeen calendars O. of parameters Part 4 Gregorian type Calendars P Gregorian type calendars Q. Calculation of g in terms of J for Gregorian type calendars R. Calculation of g in terms of Y' S. Setting up a new Gregorian type calendar, X T Parameters for 4 Gregorian type calendars U. The derivation of equation 32 from 31 Part 5 Congruence relations V. Congruence relations W. Applications of the congruence relation algorithm (CRA) X Congruence relations required by the conversion algorithms Y Table of congruence parameters Part 1. Mathematical notes -------------------------- A. Some properties of integer division and the MOD function ------------------------------------------------------------ The algorithms depend heavily on the properties of integer division and the MOD function. We start by describing these and proving a number of theorems about them. Each theorem is allocated an R number; we shall later refer to them by their R number. Notation: A, B, K are assumed to be positive integers It is assumed also that K >= 1 Since the ASCII character set used in .TXT documents does not include a full set of mathematical symbols we use: A <= B to imply that A is less than or equal to B A >= B A is greater than or equal to B A <> B A is not equal to B Definitions: R1. We define A/K to be equal to the largest integer C, where KC <= A In plain language, A/K denotes the result of dividing A by K and discarding any remainder. R2. We define MOD(A,K) = A - K(A/K) In plain language, MOD(A,K) denotes the remainder (if any) when A is divided by K Propositions 3 to 9 are elementary properties: R3. If A < K then A/K = 0 If A/K = C and A < K and, by R1, KC <= A so that KC <= A < K or KC < K. The only possible positive integral value of C is 0. Q.E.D. R4. (KA)/K = A but note that if neither A nor B are multiples of K: (AB)/K <> A(B/K) <> B(A/K) and in particular, if A is not a multiple of K: A = (AK)/K <> K(A/K) R5. (KA+B)/K = A + B/K if B >= 0 R6. (KA+B)/K = A if 0 <= B < K (by R5 and R4) R7. (KA-B)/K = A - B/K - 1 or = A - B/K If 1 <= B <= KA and if B is not divisible by K then (KA-B)/K = A - B/K -1 but if B is divisible by K then (KA-B)/K = A - B/K If KA < B then (KA-B)/K = A - B/K In particular, if 0 < B < K then (KA-B)/K = A - 1 R8. 0 <= MOD(A,B) <= B - 1 R9. If A < B then MOD(A,B) = A R10. MOD(A + nK,K) = MOD(A,K) where n is any positive integer, since by R2: MOD(A + nK,K) = A + nK - K((A+nK)/K) then by R5: MOD(A + nL,K) = A + nK - K(n + A/K) = A - K(A/K) = MOD(A,K) (by definition R2) Q.E.D. We now consider any two positive integers M and N such that M > N and M = Kp + q N = Kp' + q' Then: M/K = p and MOD(M,K) = q N/K = p' and MOD(N,K) = q' We then have: R11. (M+N)/K = (Kp + q + Kp' + q')/K = [K(p+p') + (q+q')]/K = p + p' + (q+q')/K Note that 0 <= q+q' < 2K, so that: if q+q' < K then (q+q')/K = 0 if q+q' >= K then (q+q')/K = 1 Then: (M+N)/K = M/K + N/K If q+q' < K = M/K + N/K + 1 If q+q' >= K R12. (M-N)/K = (Kp + q - Kp' - q')/K = [K(p-p') + (q-q')]/K Note that -(K-1) <= q-q' <= K-1 so that, by R7: (M-N)/K = M/K - N/K if q >= q' (M-N)/K = M/K - M/K - 1 if q < q' R13. MOD(M+N,K) = MOD(Kp + q + Kp' + q',K) = MOD[K(p+p') + (q+q'),K] = MOD(q + q',K) (by R11) Here 0 <= q+q' <= 2(K-1) If q+q' < K, then: MOD(q+q',K) = q + q' (by R9) but if K <= q+q' <= 2(K-1) so that 0 <= q+q'-K <= K, then MOD(q+q',K) = q + q' - K Then: MOD(M+N,K)= MOD(M,K) + MOD(N,K) If q+q' < K or = MOD(M,K) + MOD(N,K) - K If q+q' >= K R14. MOD(M-N,K)= MOD(Kp + q - Kp' - q',K) = MOD[K(p-p') + (q-q'),K] = MOD(q - q',K) Here -(K-1) <= q-q' <= (K-1) If q-q' >= 0, then: MOD(q - q',K) = q - q' But if -(K-1) <= q-q' < 0, so that 2 <= q-q'+K < K then; MOD(q - q',K) = MOD(K + q - q',K) = q - q' + K so that: MOD(M-N,K)= MOD(M,K) - MOD(N,K) If q >= q' or = MOD(M,K) - MOD(N,K) + K If q < q' R15. If M is a multiple of K, which implies that q = 0, we have: M/K - N/K = (M-N-1)/K + 1 = (M-N-1+K)/K There are two cases to consider: A. If q' > 0 we have by R12: M/K - N/K = (M-N)/K + 1 but since M-N is not a multiple of K, we have by R6: M/K - N/K = (M-N-1)/K + 1 B. If q' = 0 we have by R12: M/K - N/K = (M-N)/K and since M-N is, in this case, divisible by K, we find by R7: (M-N-1)/K = (M-N)/K - 1/K - 1 = (M-N)/K - 1 (by R3) which gives: M/K - N/K = (M-N-1)/K + 1 so that in both cases (q' > 0 and q' = 0) we find that: M/K - N/K = (M-N-1)/K + 1 = (M-N-1+K)/K (by R5) R16. For any M, with M = Kp + q (so that p = M/K) we have: M - M/K = [R(M+1)]/K where R = K - 1 Since we have: [R(M+1)]/K = [R(Kp + q + 1)]/K (since M = Kp+q) = [RKp + Rq + R]/K (multiplying bracket by R) = Rp + [Rq+R]/K (by R5) = Rp + [Kq + R - q]/K since Rq = Kq - q) = Rp + q (by R5, since R-q < K) = Kp + q - p (since Rp = Kp - p) = M - M/K Q.E.D. Part 2 Regular Calendars ------------------------- B. Introduction --------------- In the derivation below, we use the notation described in Mapping Time (4). Any day is defined by its date which gives in some calendar, X, its day of the month number (D), its month number (M), its year number , Y, the era and the calendar. We designate the calendar to which a date (D/M/Y) refers by writing its Abbreviated name in parentheses after the date; e.g. 1 Jan 4713 B.C. (J) or 1/1/4713 B.C. (J) refers to a date in the Julian calendar - J. Each calendar, X, has an epoch. This is the day designated by 1/1/1(X).Dates Corresponding to days before the epoch are proleptic dates. We suppose that there are n months in the year of a regular calendar. It is normal practice to designate the days of the month by the ordinal numbers 1,2,3,... and to similarly designate the months of a year by the ordinal numbers 1,2,3...n. Likewise the years are numbered from the epoch of the calendar: 1,2,3,... Imagine the days as a very long sequence of ordered objects. These days may be allocated sequential day numbers starting at some selected day, 'Day Zero', which is given the number zero. The day number thus defines every day in the sequence. Days before Day Zero would have a negative day number, but it is important to avoid these by chosing Day Zero to be before any date of interest. It is convenient for some purposes to define Day Zero as the day which has a Julian Day number of zero. Julian Day numbers have been used by chronologists and astronomers for several centuries. With this choice, Day Zero is 1/1/4713 B.C.(J) or 24/11/4714 B.C. (G). However this choice of Day Zero is arbitrary and for some purposes (such as when we are interested in dates before 1 Jan 4713 B.C.) it is useful to define Day Zero as 1/1/12000 B.C (J). Other Day Zeros could be used if dates before 1/1/12000 B.C. are of interest. The algorithms permits the calculation of a day number, J, corresponding to a date, D/M/Y, in a variety of calendars - and vice versa. The basic algorithm is designed for 'Regular' calendars (defined below), however, the algorithm can be readily extended to more complicated calendars (such as the Gregorian calendar). C. Intercalation Cycles ----------------------- An intercalation cycle (or I-cycle for short) is a sequence of consecutive years such that each cycle contains: 1. A fixed number of years, r 2 A fixed number of days, p In any regular calendar, the I-cycles repeat endlessly. An I-cycle can contain zero or more intercalated days. Some contain no such days; others contain just 1 and the Islamic calendars contain 11 such days. Any year in an I-cycle can contain at most one intercalated day (or leap day). A year which contains no leap days is termed a common year; a year which contain a leap day is termed an embolismic year (or leap year). We denote the number of embolismic years in an I-cycle by E. The first day of an I-cycle is defined differently according to the number of embolismic years it contains. Thus: 1. If E = 0 The first day is the first day of any year. 2. If E = 1 The first day is day following the leap day 3. If E > 1 The first day of the first I-cycle is the epoch. Later I-cycles start np days after this where n is any integer The intercalated day (if any) may be inserted at any point in the year, according to the convention of the calendar. Some calendars (Gregorian type calendars) intercalate at less regular intervals and these require special treatment (see below). D. The computational calendar (CC) ---------------------------------- The algorithms require the definition of another calendar, the Computational Calendar (CC) in terms of the calendar of interest (X). Each date, D/M/Y, in X corresponds to a date, D'/M'/Y' in the CC. This computational calendar has the following features: 1. Each month in CC starts with the same day as the corresponding month in X and thus there are the same number of days in any month in CC as in the corresponding month of X 2. The numbering of the days of the months in CC and in X differ. Thus if the days in a month of X are numbered 1,2,3,... d, the corresponding days in CC are numbered 0,1,2,... d-1 3. Month m in X corresponds to month 0 in the CC. Thus if the months in X are numbered: 1,2,3...n, the months of the CC are numbered: 0,1,2,3...n-1 and aligned so that month 0 on the CC corresponds to month m in X. 4. The years in CC start on different days than in X and are numbered 0,1,2,3... The years of CC start as follows: A. If there is no intercalated day in a year of X, and all the months are of the same length, a year of CC starts with the same day as a year in X. B. If there is no intercalated day but the length of one of the months is anomalous, the first day of a year in CC is first day of the month that follows the anomalous month. C. If there is an intercalated day in a year of X, the first day of the year of CC is the day following the intercalated day. Thus any intercalated day is at the end of a year in CC 5. The epoch of CC is the first day of an I-cycle, the latest whose start precedes day zero. The two essential points of the computational calendar are that: A. The intercalated day comes at the very end of a year in CC; this removes any difficulties associated with it. B. Since the numbers assigned to a day, month and year in CC start at zero (rather than 1) the calculation of the number of days preceding any day is greatly facilitated. We suppose that the month M in X which corresponds with the month 0 in the CC is month m (M=m). i.e. if M = m, M' = 0 if M = m+1, M' = 1 . . if M = n M' = n-m if M = 1, M' = 1+n-m if M = 2, M' = 3+n-m It is important to note that the year in the CC into which months M = 1 to m-1 fall is one less than the year in which month M = m to n fall and that the months in a year of the CC correspond to a cyclic permutation of the months in X. This is clarified by the table of correspondences where have assumed n = 12 and m = 3: M 1 2 3 4 5... 12 M' 10 11 0 1 2... 9 Y' z z z+1 z+1 z+1 z+1 (where z is some arbitrary year number) It follows that the epoch of the CC, i.e. the date 0/0/0 (CC), must be the first day of an intercalation cycle. This epoch of the CC is taken to be the first day of the last intercalation cycle whose start precedes day zero. E. Outline of the Algorithm --------------------------- The calculation of a Day Number corresponding to a date (D/M/Y) proceeds in two steps; 1a. From D/M/Y we first calculate the corresponding date in the CC, expressed as D'/M'/Y' 2a. From D'/M'/Y' we next calculate J, the day number The converse calculation similarly proceeds in two steps: 1b. From J, calculate D'/M'/Y' 2b. From D'/M'/Y', calculate D/M/Y Schematically D/M/Y <----> D'/M'/Y' <----> J F. The interconversion of D'/M/'Y' (CC) and D/M/Y (X) ----------------------------------------------------- Since days of the months of X are labelled from 1 to n and those of the CC from 0 to n-1 , we may put: D' = D - 1 (1a) D = D' + 1 (1b) Since the order of the months in the CC is a cyclic permutation of the months in the given calendar we may put: M' = MOD(M - m + n, n) (2a) M = MOD(M' + m - 1, n) + 1 (2b) It is easily verified that M' = 0 when M = m in both these equations. = 1 = m+1 etc. Finally we need a relation between Y' and Y which we write: Y' = Y + y - k. Here y is the number of years in the CC which precede the epoch of X. k takes into account the fact that Y' depends on the month, M'. We discuss the term y further below but consider k here. Since the CC year starts with the month designated by M = 3 or M' = 0, the months designated by M = m, m+1,...n belong to the CC year following that to which months M = 1,2,...m-1 belong. Thus, if M >= m, the term k must be one less than if M < m. We thus require that: k = 0 if M >= m k = 1 if M < m If we put k = (n + m - 1 - M)/n, we find that: k = 0 if (n + m - 1 - M) < n or M > m - 1 or M >= m and likewise: k = 1 if (n + m - 1 - M) >= n or M =< m - 1 or M < m (Note that (n+m-1-M) < 2n for all M) We may thus write: Y' = Y + y - (n+m-1-M)/n (3a) Y = Y' - y + (n+m-1+M)/n (3b) G. The conversion of dates (D'/M'/Y') to day numbers (J) -------------------------------------------------------- Once we have converted a date (D/M/Y) in calendar X into a date (D'/M'/Y') in the CC using equations (1a), (2a), (3a), we must convert the latter to a day number (J). We may write: J = c + d + D' - j (4) where: c is the number of days in the computational calendar that precede the year Y'. d is the number of days in the computational year Y' which precede month M'. D' is the number of days in month M' which precede (D'/M'/Y') j is the number of days by which the epoch of the CC (0/0/0) precedes Day Zero. We take this to be self evident c may be given by a congruence relation of the form: c = (pY' + q)/r (5) Here r is the number of years in the intercalation cycle p days and q has to be determined for each calendar and which may be zero. Likewise d may be given by a congruence relation of the form: d = (sM' + t)/u (6) where s, t and u have to be determined for each calendar. It is possible that one or more of these congruence relations does not exist for some calendar. In that case the calendar is not strictly regular. Nevertheless it is possible that c and d can be calculated in some other way. Assuming it is so, we then have: J = (pY' + q)/r + (sM' + t)/u + D' - j (7) H. The conversion of day numbers (J) to dates (D'/M'/Y') -------------------------------------------------------- The first step is to calculate the number of days, J', in the computational calendar which precede J. Thus: J' = J + j (8) We next find the number of complete years, Y', contained in this period and the number of days, T', in the current CC year, which remain after the last complete year. Again we utilise congruence relations (if they exist): Y' = (rJ' + v)/p (9) T' = MOD(rJ' + v,p)/r (10) where v (which may be zero) must be determined for each calendar. Given T', we may calculate the number of months, M', which precede the current day: M' = (uT' + w)/s (11) D' = MOD(uT' + w,s)/u (12) where w must be determined for each calendar. The date (D'/M'/Y') in CC so found may then be converted to a date in calendar X as explained above. I. The Epoch of the computational calendar ------------------------------------------ Some of the formulae given above contain the quantities: y The number of years of the epoch of CC which precede the epoch of X j The number of days by which the epoch of the CC (0/0/0) precedes Day Zero. We must now investigate how to calculate y and j for any calendar, X. First define Jg to be the epoch of calendar X; i.e. Jg is the day number of the date 1/1/1 (X) And then define J1 to be the first day of the first I-cycle which starts after Jg. We suppose that this day is x days after Jg so that: x = J1 - Jg (13) The number of complete cycles each containing p days that are included in the period that starts at Day Zero and ends at the day before J1 is given by b in: b = (Jg + x)/p (14) The first of these I-cycles will start on a day Jk which is less than p days after Day Zero; Jk marks the first day of the first I-cycle which starts after Day Zero. The I-cycle preceding this first cycle will start before Day Zero on a day which we call Jc. We take this day, Jc, to be the epoch of the computational calendar. Then the number of days in the computational calendar which precede the day J1 is p(b+1). Since the first computational year is called year 0, the computational year for which J1 is the first day, is year r(b+1). J1 is x days after Jg and these x days contain x/C years where C is the number of days in a common year. C can be expressed in terms of p (the number of days in an intercalation cycle) and r (the number of years in a cycle) so that: C = p/r (15) It follows that the day J1 lies in year 1 + x/C of calendar X. It then follows that year Y' = r(b+1) in the CC corresponds to year Y = 1 + x/C in X. These values of Y' and Y may be substituted into equation (3a) to give: r(b+1) = 1 + x/C + y - (n+m-1-M)/n (16) Since day J1 falls at the start of an intercalation cycle such that M = m, we have (n+m-1-M)/n = 0 so that solving for y, we have: y = r(b+1) - 1 - x/C = rb + (r - 1 - x/C) (17) Substituting the expression for b from equation (14) we find: y = r[(Jg + x)/p] + (r - 1 - x/(p/r)) = r(J1/p + 1) - (1 + x/(p/r)) (18) Next, to calculate j, first note that: 1. Day Zero falls j days after Jc 2. Jg falls Jg days after day zero 3. J1 falls x days after Jg 4. J1 fall p(b+1) days after Jc This may be more apparent in the diagram below: Jc 0 Jk Jg J1 -----|------------|------|--------------------------|------| | | | | Days |<----j----->|<---------------J--------------->|<-x-->| |<---------------------p(b+1)------------------------>| | | | | Years |<---------------------r(b+1)------------------------>| | |< x/C>| | | | | Cycles|<--------1-------->|<--------------b---------------->| It then follows that: p(b+1) = j + Jg + x (19) Equation (14) gives an expression for b which may be substituted in (19) to give: p[(Jg + x)/p + 1] = j + Jg + x (20) By definition J1 = Jg + x, so that: j = p[J1/p] + p - J1 (21) We now utilise the mathematical identity (see R2 in section A): p[J1/p] = J1 - MOD(J1,p) (22) to find that: j = J1 - MOD(J1,p) + p - J1 = p - MOD(J1,p) (23) To recap, we have: y = r(J1/p + 1) - (1 + (J1-Jg)/(p/r)) (18) j = p - MOD(J1,p) (23) It should be noted that y and j are constants that need be calculated only once for each calendar using the appropriate values of r, p, Jg and J1. To recap the definitions given above: Jg is the day number of the epoch, 1/1/1 (X), of calendar X J1 is the day number of the day following the first intercalated day after the epoch (1/1/1) of calendar X. p is the number of days in an intercalation cycle r is the number of years in an intercalation cycle It may also be noted that p = rC + E for a regular calendar where: C is the number of days in a common year E is the number of intercalated days (0 or 1) in an intercalation cycle J. The complete algorithm for converting D/M/Y to J --------------------------------------------------- 1. Y' <= Y + y - (n + m - 1 - M)/n (3a) 2. M' <= MOD(M - m + n,n) (2a) 3. D' <= D - 1 (1a) 4. J <= (p*Y' + q)/r + (s*M' + t)/u + D' - j (7) or more succinctly and avoiding the components of the computation calendar entirely: 1. h <= M - m 2. J <= (p*[Y + y - (n - h - 1)/n] + q)/r + (s*MOD(h + n,n) + t)/u + D - 1 - j K. The complete algorithm for converting J to D/M/Y --------------------------------------------------- 1. J' <= J + j 2. Y' <= (r*J' + v)/p 3. T' <= MOD(r*J' + v,p) 4. M' <= (u*T' + w)/s 5. D <= MOD(u*T' + w,s)/u + 1 6. M <= MOD(M' + m - 1,n) + 1 7. Y <= Y' - y + (n + m - 1 - M)/n or slightly more succinctly: 1. J' <= J + j 2. T' <= MOD(r*J' + v,p) 3. D <= MOD(u*T' + w,s)/u + 1 4. M <= MOD[(u*T' + w)/s + m - 1,n] + 1 5. Y <= (r*J' + v)/p - y + (n + m - 1 - M)/n L. The parameters of regular calendars -------------------------------------- Any regular calendar is defined by a number of parameters: Firstly day numbers (in temporal order): Jc The day number of the epoch [0/0/0 (CC)] of the CC This is the day number of the first day of the last intercalation cycle which precedes Day zero. 0 Day Zero Jk The day number of the first day of the first intercalation cycle which follows Day Zero Jg The day number [1/1/1 (X) of the epoch of the calendar X. J1 The day number of the first day of the first intercalation cycle which comes after Jg Next some parameters which define the structure of the calendar: n The number of months in a year. Any epagomenal days are taken to define a eparate (short) month m The month number of the calendar X which corresponds to the first month (labelled month 0) of the CC (1= D'/M'/Y' <---> Jj <---> Jg Here, Jj is the day number corresponding to any day, D/M/Y, interpreted as being in the JT-calendar and JG the day number of D/M/Y interpreted as being in the GT-calendar. This stratagem requires a method of calculating Jj from Jg (or vice versa) and we put: g = Jj - Jg (24) so that equation 4, used in converting dates to day numbers, is replaced by: J = c + d + D' - j - g (25) and equation (8), used in converting day numbers to dates by: J' = J + j + g (26) (8g) It remains to calculate appropriate values of g. We require expressions for g in terms of: Y' if we are converting dates to day numbers, J j if we are converting day numbers, J, to dates It is necessary to, select for the Gregorian type calendars of interest some day, Jo, which is the first day of a G-cycle and for which we know the corresponding value, go, of g. For instance for the Gregorian calendar we know that go = 10 in 1600 and we may take Jo to be the day number of 1/3/1600 (G). We further suppose that Jo falls in year Yo of the Gregorian type calendar or Yo' of the corresponding computational calendar (CC) so that Yo' = Yo + y where y has been defined above. If no leap days were ever suppressed, the calendar would follow the same rule as the Julian calendar and go would remain at the value. But every time a leap day is suppressed, go increases by one. Thus for the Gregorian calendar itself: from 1/3/1600 to 28/2/1700 go = 10 for there is no 29/2/1700 1/3/1700 28/2/1800 = 11 29/2/1800 1/3/1800 28/2/1900 = 12 29/2/1900 1/3/1900 29/2/2000 = 13 29/2/2000 exists but at the end of the 4th C-cycle, the leap day is not suppressed so that: from 1/3/2000 to 28/2/2100 go = 13 for there is no 29/2/2100 1/3/2100 28/2/2200 14 for there is no 29/2/2200 and so on We thus see that for every complete G-cycle, go increases by 3 and for every complete C-cycle, go increases by one except for the 4th C-cycle. Q. Calculation of g in terms of J --------------------------------- There are several approaches to the calculation of g. Here we present an approach not mentioned in Mapping Time. In the expressions in this section we will use, for clarity and brevity, L rather than Ld and K rather than Kd. It is convenient to define: I = J - Jo (27) so that I is the number of days in the period starting with Jo and ending the day before J. The number of complete G-cycles in this period is: P = I/L (28) leaving MOD(I,L) days which we suppose contain Q complete C-cycles. We see that go must be incremented by 3P + Q by the time we reach day J, so that: g = go + 3P + Q (29) If all the C-cycles contained the same number of days, we could write Q = MOD(I,L)/K and Q could then take any value from 0 to 4. Q only takes the value 4 when J is the last day of the last C-cycle (which is the last day of the current G-cycle). This is because this last C-cycle contains 36525 days rather than 36524. We require Q to equal 3 on this day and so we must ensure that Q never exceeds 3. This is most simply done by replacing Q by Q - 4 where Q = MOD(I,L); The term Q/4 only equals 1 if Q = 4 and is otherwise zero. We may therefore write: Q = MOD(I,L)/K - (MOD(I,L)/K)/4 (30) so that; g = go + 3(I/L) + MOD(I,L)/K - (MOD(I,L)/K)/4 (31) This expression can be greatly simplified by purely mathematical transformation, but this is quite lengthy and requires careful attention to the properties of integer division. the result (explained more fully in Section U below) is: g = go + {[3[(4J + B)/L]}/4 (32) where: B = L + 4(1 - Jo) (33) Equation (32) is however only valid if J >= Jo. Nevertheless, this is easily corrected, for the choice of Jo is arbitrary - the only consideration is that it should be the first day of a G-cycle of known go. If we were to have selected the previous G-cycle, go would be reduced by 3 and Jo increased by L. We can thus select any G-cycle by subtracting (or adding) Ln from Jo and subtracting 3n from go where n is any integer. Thus equations (32) and (33) may be written: g = go - 3n + {[3[(4J + B)/L]}/4 (34) B = L + 4(1 - Jo + Ln) (35) These are now valid for any day J >= Jo - Ln. If we wish them to be valid for any positive J, from Day zero on, we must ensure that 0 >= Jo - Ln. This gives a minimum value of n as: n = 1 + Jo/L (36) This finally gives: g = G + {[3[(4J + B)/L]}/4 (37) G = go - 3(1 + Jo/L) (38) B = 5L - 4[1 - MOD(Jo,L)] (39) R. Calculation of g in terms of Y' ---------------------------------- In the expression in this section we will use, for clarity and brevity) L rather than Ly and K rather than Ky. It is convenient to define: Z = Y - Yo = Y' - Yo' (40) so that Z is the number of years in the period starting with Yo and ending the day before J. As in the previous section we write: g = go + 3P + Q (29) The number of complete G-cycles in this period is: P = I/L (41) leaving MOD(Z,L) years which we suppose contain Q complete C-cycles. All the C-cycles contain the same number of years so that we may write: Q = MOD(Z,L)/K (42) which leads to: g = go + 3(Z/L) + MOD(Z,L)/K (43) = go + 3(Z/L) + (Z - L(Z/L))/K (44) Put Z/L = a to obtain: g = go + 3a + (Z - La)/K (45) Then since L = 4K, we have: g = go + (3Ka + Z - 4Ka)/K (46) = go + [Z - K(Z/4K)]/K = go + Z/K - (Z/K)/4 (47) Applying rule R16 we find: g = go + [3(1 + Z/K)]/4 = go + [3[1 + (Y'-Yo')/K]/4 (48) In section N above we explained how to shift the selected G-cycle so that the formula was valid for all days of interest. We employ the same ruse here to ensure that the formula is valid for all years of interest by decreasing Yo by a multiple, n, of L and decrease the effective value of g by 3n. We thus find: g = go - 3n + [3[K + Y' - Yo' + Ln)/K]/4 (49) so that: g = G + [3(Y' + A)/K]/4 (50) where: G = go - 3n (51) A = K + Ln - Yo' = K + Ln - Yo - y (52) If this is to be valid for any year of interest we must have: Y' + A >= 0 (53) Since the lowest value of Y' is zero, we must then have A >= 0 (54) which gives: K + Ln - Yo - y >= 0 (55) or: n >= (Yo + y - K)/L (56) To ensure this put: n = 1 + (Yo + y - K)/L (57) = (4K + Yo + y - K)/L = (3K + Yo + y)/4K (58) We use this value of n to calculate, once and for all for each Gregorian type calendar: G = go - 3n (59) A = K - Yo - y + Ln = K(1 + 4n) - (Yo + y) (60) and use these to calculate for any value of Y' in: g = G + [3(Y' + A)/K]/4 (61) S. Setting up a new Gregorian type calendar, X ---------------------------------------------- First decide what day is to be Day Zero 1. Ascertain a correlation date: i.e. A date in X and the corresponding date and day number in the Julian calendar. 2. Work out all the parameters described in section M assuming that the calendar is not Gregorian type (i.e. there are no G-cycles bigger than an I-cycle. 2. Ascertain the date in X, Do/Mo/Yo of the first day of some G-cycle in X whose go is known 3. Work out the value of Jo for this G-cycle 4. Ascertain the appropriate value of go for this G-cycle 5. Ascertain the value of y from y = r[J1/p + 1] - (1 + x/(p/r)) as described above 6. Calculate n from: n = (300 + Yo + y)/400 7. Calculate G from: G = go - 3n 8. Calculate A from: A = 100(1 + 4n) - (Yo + y) 9. Calculate B from: B = 730485 - 4[1 - MOD(Jo,146097)] T. Parameters for 4 Gregorian type Calendars --------------------------------------------- In Table 3A we show the parameters for several Gregorian type calendars: Date (X) The date in the calendar which is the first day of a G-cycle for which we know go Date (J) The date of this day in the Julian calendar Yo for this G-cycle go the known value of g on this day -------------------------------------------------------------- Table 3A -------------------------------------------------------------- # Calendar Date (X) Date (J) Yo go -------------------------------------------------------------------------- 7 Republican 1/1/0 E.R. 12/9/1791 A.D. 0 0 11 Gregorian 1/3/1600 A.D. 20/3/1600 A.D. 1600 10 14 Bahai 1/20/1 E.B. 18/2/2000 A.D. 156 1 15 Saka 1/2/322 E.S. 20/4/400) A.D. 322 3 ------------------------------------------------------------------------- In Table 3B we show for these same 4 calendars parameters bases on Day Zero being 1/1/4716 B.C. (J): Jo or Date (J) y as taken from table 1 n calculated from equation (36) or (38) n = 1 + Jo/Ld (36) n = (3Ky + Yo + y)/4Ky (58) (They give the same value) A calculated from equation (60) and (36) A = Ky(1 + 4n) - (Yo + y) (60) B calculated from equation (39) B = 5Ld - 4[1 - MOD(Jo,Ld)] (39) G calculated from equation (38) or (59) and (58) G = go - 3(1 + Jo/Ld) (38) G = go - 3n (59) (they give the values) -------------------------------------------------------------------------------- Table 3B -------------------------------------------------------------------------------- # Calendar Jo y n A B G -------------------------------------------------------------------------------- 7 Republican 2375475 6504 17 396 578797 -51 11 Gregorian 2305508 4716 16 184 274277 -38 14 Bahai 2451606 6560 17 184 274273 -50 15 Saka 1867268 4794 13 184 274073 -36 -------------------------------------------------------------------------------- In Table 3C we show data similar to that in Table 3B but based on Day Zero being 1/1/12000 B.C. (J) -------------------------------------------------------------------------------- Table 3C -------------------------------------------------------------------------------- # Calendar y* n* A* B* G* -------------------------------------------------------------------------------- 7 Republican 5037052 13792 35 308 451473 -105 11 Gregorian 4967085 12000 34 100 146953 -92 14 Bahai 5113183 13844 35 100 146949 -104 15 Saka 4528845 12078 31 100 146749 -90 -------------------------------------------------------------------------------- U. The derivation of equation 32 from 31 ------------------------------------------ We start with: g = go + 3(I/L) + MOD(I,L)/K - [MOD(I,L)/K]/4 (31) It is convenient to define: a = I/L and b = MOD(I,L) = I - La (a) From R2 and substituting for I/L and I - La: g = go + 3a + b/K - [b/K]/4 (b) Applying R16 to the last two terms: g = go + 3a + [3(b/K + 1)]/4 = go [{3(4ak + b + K)}/K (c) Now define: X = 4aK + b + K, so that g = go + [3(X/K)]/4 (d) and note that X = 4aK + I - La + K (e) = 4aK + I - a(4K+1) + K (since L = 4K+1) = I - a + K = I - I/L + K (since a=I/L) (f) = IL/L - I/L + K (g) = (IL - I - 1)/L + 1 + K (by R15) (h) = (4KI - 1)/L + 1 + K (since L=4K+1) = (4KI - 1 + L + KL)/L = (4KI - 1 + 4K + 1 + KL)/L (since L=4K+1 = [K(4I + 4 + L)]/L (i) X/K = [4(I + 1) + L]/L (j) Remembering that: g = go + (3{X/K})/4 (d) we then find: g = go + (3{[4(I + 1) + L]/L})/4 (k) = go + (3{[4J - 4Jo + 4 + L]/L})/4 (since I=J-Jo) = go + (3[(4J + B)/L])/4 (32) where: B = L + 4(1 - Jo) (33) QED Part 5 Congruence Relations --------------------------- V. Congruence relations ------------------------ A congruence relation is a formula for calculating P from Q given M pairs of values (P,Q) which takes the form: P = (A*Q + x)/B It is first necessary to chose values for A and B. The problem then is to find an appropriate value of x. In general we may write for every data pair: BP =< AQ + x =< BQ + B - 1 or BP - AQ =< x =< BP - AQ + B - 1 For each pair of values P,Q we may calculate: Min(x) = BP - AQ a minimum value of x Max(x) = BP - AQ + B - 1 a maximum value of x If there is a value of x which is greater or equal to the largest Min(x) and smaller or equal to the smallest Max(x), this value of x is the one required. If there is no such x, a congruence relation with the chosen A and B cannot be found. The selection of appropriate values of A and B (if any exist) is not straight forward. One possibility is to try A = P(M) and B = Q(M). If this does not work, one must try others, but it is a matter of trial and error, perhaps aided by a detailed consideration of the sequences represented by P and Q. There is no guarantee that any congruence relation exists for a given set of data. W. Applications of the congruence relation algorithm (CRA) ------------------------------------------------------------ We first list several parameters which are used consistently in this and the next section. The notation used is also consistent with that used in Mapping Time (ref 4). The parameters refer exclusively to the Computational Calendar (CC) (rather than to the given calendar X). We refer to the current day (of interest). This day is day J' of the CC, with its epoch having J'=0. It is assigned to a day of the month (D') of month M', the current month, in year Y', the current year and is designated day D'/M'/Y'. Each year resides in the current intercalation cycle (I-cycle). The epoch of the CC is 0/0/0 with J' = 0. Since the counting of D', M', Y' starts at zero, the number of days in month M', which precede D' is D'. Likewise M' month precede M' in Y' and Y' years precede year Y'. Parameters used consistently below are: Length of years and cycles r = the number of years in an I-cycle p = the number of days in an I-cycle K = the number of days in a common year = p/r Counts of I-cycles I = the number of complete I-cycles which precede J' Counts of years Y' = the number of complete years that precede J' y = the number of complete years in the current I-cycle which precede the current day, current month or current year e = the number of embolismic years (or intercalated (leap) days) in the current I-cycle which precede the current year Counts of months M' = the number of months in the current CC year that precede the current month Counts of days J' = the number of days in the CC which precede the current day c = the number of days in the CC which precede the current year d = the number of days in the current year which precede the current month T' = the number of days in the current year which precede the current day (i.e. the day of the current year) D' = the number of days in the current month which precede the current day We now consider 7 congruence relation required in the next section: I. The number of days preceding month M' in the current year of the CC for Julian/Gregorian type calendars. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The number of days in each month of these calendars appears to be quite irregular but Hatcher discerned a pattern. Below we give in Table I: M the conventional month number M' the corresponding month number in the CC L the number of days in each month X the excess over 28 of days in each month Z the aggregate of the excesses for the months preceding each M' d the number of days in the CC year which precede month M' Table I Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb M 1 2 3 4 5 6 7 8 9 10 11 12 1 2 M' 10 11 0 1 2 3 4 5 6 7 8 9 10 11 L 31 28 31 30 31 30 31 31 30 31 30 31 31 28 X 3 0 3 2 3 2 3 3 2 3 2 3 3 0 ----------------- ----------------- - Z 0 3 5 8 10 13 16 18 21 23 26 29 d 0 31 61 92 122 153 184 214 245 275 306 337 We apply the CRA taking P = Z and Q = M' to find: Z = (AM' + x)/B = (13M' + 2)/5 (I) with A = 13, B = 5 and x = 2. It is Zeller's admirable contribution to discover these values of A and B II. The number of days preceding month M' in the current year of the CC for Islamic calendars. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The number of such days is more regular as seen below in Table II which contains the same information as the previous table: Table II M 1 2 3 4 5 6 7 8 9 10 11 12 M' 0 1 2 3 4 5 6 7 8 9 10 11 L 30 29 30 29 30 29 30 29 30 29 30 29 X 1 0 1 0 1 0 1 0 1 0 1 0 Z 0 1 1 2 2 3 3 4 4 5 5 6 d 0 30 59 89 118 148 177 207 236 266 295 325 We apply the CRA taking P = d and Q = M' to find: d = (AM' + x)/B = (2951M' + 51)/100 (II) with A = 2951, B = 100 and x = 51 The value of x is not unique; in fact x may take any value from 49 to 89 III.The month of the CC in which resides day T' for Julian/Gregorian type calendars ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is the converse of the relation found above in (I) The range of values of T' corresponding to each value of M' (0 - 11) is readily found and given in Table III: Table III M 1 2 3 4 5 6 7 8 9 10 11 12 1 2 M' 10 11 0 1 2 3 4 5 6 7 8 9 10 11 First T' 0 31 61 92 122 153 184 214 245 275 306 337 Last T' 30 60 91 121 152 183 213 244 274 305 336 366 We apply the CRA taking P = M' and Q = T' for all 366 possible values of T' to find: M' = (AT' + x)/B = (5T' + 2)/153 (III) with A = 5, B = 153 and x = 2 The values of A and B are suggested by Zeller's congruence. IV. The month of the CC in which resides day T' Islamic calendars ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is the converse of the relation found above in (II) The range of values of T corresponding to each value of M' (0 - 11) is readily found and given in Table IV: Table IV M 1 2 3 4 5 6 7 8 9 10 11 12 1 2 M' 10 11 0 1 2 3 4 5 6 7 8 9 10 11 First T' 0 30 59 89 118 148 177 207 236 266 296 325 Last T' 29 58 88 117 147 176 206 235 265 294 324 354 We apply the CRA taking P = M' and Q = T' for all 354 possible values of T' to find: M' = (AT' + x)/B = (100T' + 10)/2951 (IV) with A = 100, B = 2951 and x = 10 V. The number complete years, y, preceding day i of an intercalation cycle for Julian type calendars (with r = 4 and p = rx365 + 1). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For i = 0 - 364 we have y = 0 365 - 729 y = 1 730 - 1094 y = 2 1095 - 1461 y = 3 We apply the CRA taking, for all 1461 possible values, P = y and Q = j to find: y = (Ai + x)/B = (4i + 3)/1461 with A = 4, B = 1461 and x = 3 We find in a similar way for r = 1,2,3 or 4 that: y = (ri + r - 1)/p (V) with A = r, B = p, x = r-1 VI. The number of embolismic years, e, which precede year y of an I-cycle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In the Islamic calendar, an extra day is intercalated at the end of certain years in a 30 year cycle making that year embolismic. Counting the years of a cycle from 1 to 30, the embolismic years are: 2,5,7,10,13,15,16,18,21,24,26,29. Thus we tabulate for every possible year of the cycle, y: y: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 e: 0 1 1 1 2 2 3 3 3 4 4 4 5 5 5 6 6 7 7 7 8 8 8 9 9 10 10 10 11 11 We apply the CRA taking P = e and Q = y to find: e = (Ay + x)/B = (11y + 14)/30 (VI) with A = 11, B = 30 and x = 14 Note that A = E and B = r VII. The number complete years, y, preceding day i of a 30 year I-cycle for Islamic calendars. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The sequence of embolismic years in the 30-year cycle is irregular, but it is easy (though tedious without a computer) to tabulate y as a function of i for all p = 10631 days of a cycle. We may note that the range of values of i which correspond to any given value of y is easily found to be: First i = 354y + e(y) Last i = 354(y+1) + e(y+1) - 1 where e(y) is the value of e given for y by CRA VI above. We apply the CRA taking P = y and Q = j for all 10631 values to find: y = (Ai + x)/B = (30i + 15)/10631 (VII) with A = 30, B =10631 and x = 15. Note that A = r and B = p X. Congruence relations required by the conversion algorithms --------------------------------------------------------------- There are 6 of these (A-F): A. c = (pY' + q)/r (5) requires: r,p and q B. d = (sM' + t)/u (6) u,s,t C. Y' = (rJ' + v)/p (9) r,p and v D. T' = MOD(rJ' + v,p)/r (10) r,p and v E. M' = (uT' + w)/s (11) u,s,w F. D' = MOD(uT' + w,s)/u (12) u,s,w Appropriate values of r and p are given in Table 2 and those for q,v,u,s,t and w are collected together in Table 4 below for each of 17 calendars. The derivation of the relations A-F and the specification of the relevant parameters (q,v,u,s,t,w) requires the results of the applications of the CRA described in section W. We now consider the 5 relations required by the conversion algorithms. A. c = (pY' + q)/r (5) ----------------------------------- Here: c is the number of days which precede the current year Y'is the current year. The number of complete I-cycles, of r years or p days each, which precede Y', is Y'/r. The number of days in these is then p(Y'/r) and the number of years is r(Y'/r) Suppose that y years remain in the current I-cycle then y = Y' - r(Y'/r) The number of days in these y years is the sum of yK (the number of days in y common years) and the number of embolismic years in them, e. K is the number of days in a common year. We thus see that: c = p(Y'/r) + Ky + e For the Islamic calendar we found (CRA VI) that: e = (Ey + q)/r Here E is the number of embolismic years in an I-cycle and q = 14. A similar relation holds for the other calendars. For the Julian, Alexandrian and Bahai calendars, E = 1; for the Egyptian calendars E = 0. For all these calendars, there are no embolismic years in an uncompleted I-cycle so that e = 0. By putting q = 0 we obtain e = Ey/r. But since Ey < r, this gives e = 0 as required. Thus for any calendar: c = p(Y'/r) + Ky + (Ey + q)/r = p(Y'/r) + (Kry + Ey + q)/r = p(Y'/r) + [y(Kr+E) + q]/r but for all calendars, Kr + E = p, so that: c = p(Y'/r) + [py + q]/r = p(Y'/r) + [pY' - pr(Y'/r) + q]/r = p(Y'/r) - p(Y'/r) + (pY' + q)/r = (pY' + q)/r For the Islamic calendar we have: q = 14 and for all the others q = 0 B. d = (sM' + t)/u (6) ----------------------------------- Here: d is the number of days in the current year which precede the current month. M' is the current month. For Julian or Gregorian calendars, we may write this as: d = 28M' + Z where Z is the sum of the excesses. We have found above (CRA I) that: Z = (13M' + 2)/5 so that: d = 28M' + (13M' + 2)/5 = (153M' + 2)/5 Thus for such calendars: u = 5, s = 153 and t = 2 For Egyptian and Alexandrian type calendars, the number of days in each month (except the epagomenae) is a constant, 30. This immediately gives: d = 30M' so that for these calendars: u = 1, s = 30 and t = 0 Likewise, for the Bahai calendar with month of 19 days each, we find: d = 19M' with u = 1, s = 19 and t = 0 For the Islamic calendars, we found above (CRA II) the congruence relation: d = (2951M' + 51)/100 which gives: u = 100, s = 2951 and t = 51 C. Y' = (rJ' + v)/p (9) ------------------------------------ Here: Y' = the number of complete years which precede the current day. J' = is the number of days in the CC which precede the current day. The number of complete I-cycles, of r years or p days each, which precede Y', is Y'/r. The number of days in these is then p(Y'/r) and the number of years is r(Y'/r) This leaves i = MOD(J'p) days in incomplete cycles which, we suppose contain y complete years. We may note that: i = J' - p(J'/p) (R2) For calendars other than the Islamic, congruence relations (CRA V, VII) gives y in terms of I is: y = (ri + v)/p A similar relation holds for Islamic calendars (CRA VII) with v = 15. Then: Y' = r(J'/p) + y = r(J'/p) + (ri + v)/p = r(J'/p) + [rJ' - rp(J'/p) + v]/p = r(J'/p) - r(J'/p) + (rJ' + v)/p = (rJ' + v)/p For the Alexandrian, Julian and Bahai type calendars (with r = 4, p = 1461) we thus have: v = 3 For the Egyptian type calendars (with r = 1, p = 365) we have: v = 0 For Roman I calendar (with r = 3, p=1096) we have: v = 2 For Roman II calendar (with r = 1, p=365) we have: v = 0 For Islamic calendars (with r = 30, p = 10631) we have: v = 15 D. T' = MOD(rJ' + v,p)/r (10) ------------------------------------ Here: J' is the number of days in the CC which precede the current day T' is the number of days in the current year which precede the current day (i.e. the day of the year of the current day). It is clear that we may put: T' = J' - c where c is the number of days in the CC which precede year Y'. This is given above for all calendars (equation 5) as: c = (pY' + q)/r so that: T' = J' - (pY' + q)/r = rJ'/r - (pY' + q)/r = [rJ' - pY' + q - 1 + r]/r (R15) But Y' = (rJ' + v)/p = B/p where we have defined B as rJ' + v. Then: T' = [rJ' - p(B/p) + q - 1 + r)/r But by R2 we have: p(B/p) = B - MOD(B,p) = rJ' + v - MOD(B,p) so that: T' = [rJ' - rJ' - v + MOD(B,p) + q - 1 + r)/r We now tabulate values of q, v and r for the different categories of calendar using the values derived above: Calendar q v r r-1-v+q ------------------------------------------- Julian 0 3 4 0 Alexandrian 0 3 4 0 Bahai 0 3 4 0 Egyptian 0 0 1 0 Islamic 14 15 30 0 We immediately see that in all cases r-1-v+q = 0, so that we have in all cases: T' = MOD(B,p) = MOD(rJ' + v)/r Q.E.D. E. M' = (uT' + w)/s (11) ------------------------------------- Here: T' is the number of days in the current year which precede the current day (i.e. the day of the year of the current day). M' is the number of complete months contained in T'. For Julian or Gregorian type calendars, we have found (CRA III) that: M' = (5T' + 2)/153 This immediately gives: u = 5, s = 153 and w = 2. For Egyptian, Alexandrian calendars we have; M' = T'/30 which gives: u = 1, s = 30 and w = 0 and for the Bahai calendar: M' = T'/19 which gives: u = 1, s = 19 and w = 0 For the Islamic calendars we showed (CRA IV) that: M' = (100T' + 10)/2951 which gives: u = 100, s = 2951 and w = 10 F. D' = MOD(uT' + w,s)/u (12) --------------------------------- Here: T' is the number of days in the current year which precede the current day (i.e. the day of the year of the current day). D' is the day of the current month. We have the relation: T' = d + D' where d is the number of days in a year of the CC which precede month M' of the CC. Equation (6) gives: d = (sM' + t)/u T' is the day of the CC year of the day in question was given in equation (10) as: T' = MOD(rJ' + v,p)/r thus; D' = T' - (sM'+t)/u = uT'/u - (sM'+t)/u = (uT' - Sm' - t - 1 + u)/u (R16) Put u-1 = t+w and B = uT' + w, so that D' = (B-sM')/u but from equation (11), M' = (uT' + w)/s = B/s, so that: D' = (B-s(B/s))/u = MOD(B,s)/u (R2) = MOD(uT'+w,s)/u Q.E.D. The values of u, s and w are identical to those given in E. Y. Table of congruence parameters ----------------------------------- In Table 4, we collect together the values of q, v, u, s, t and w as required by the algorithms and as derived in the previous section for all 17 calendars ---------------------------------------------------- Table 4 ---------------------------------------------------- # Name q v u s t w ---------------------------------------------------- 1 Egyptian 0 0 1 30 0 0 2 Armenian 0 0 1 30 0 0 3 Khwarizmian 0 0 1 30 0 0 4 Persian 0 0 1 30 0 0 5 Ethiopian 0 3 1 30 0 0 6 Coptic 0 3 1 30 0 0 7 Republican 0 3 1 30 0 0 8 Macedonian 0 3 5 153 2 2 9 Syrian 0 3 5 153 2 2 10 Julian 0 3 5 153 2 2 11 Gregorian 0 3 5 153 2 2 12 Islamic A 14 15 100 2951 51 10 13 Islamic B 14 15 100 2951 51 10 14 Bahai 0 3 1 19 0 0 15 Saka 0 3 1 31 0 0 16 Roman I 0 2 5 153 2 2 17 Roman II 0 0 5 153 2 2 FINIS 1 1