Zeller's congruence

Zellers congruence is a mathematical way to determine the weekday of a given date. The mathematician and theologian Christian Zeller published in 1882 to a formula.

Formulas

Let h be the day of the week to be determined, q the day of the month m (where from March to December, as usual, the numbers have 3-12, January and February, the months 13 and 14 of the previous year, respectively), J the century number ( these are the first two points of the four-digit year ) and K the last two digits of the four -digit year ( for January and February according to the number of the previous year ), the following applies:

1 for a date in the Gregorian calendar:

2 for a date in the Julian calendar:

The expression ( floor function ) provides the largest integer. The mod 7 (pronounced modulo 7) at the end means that the determined value divided by 7 and the remainder by 7 left in this integer division is determined. This results in h is a number from 0 to 6, indicating the date of the week:

If the result is negative ( depending on the used modulo function ), we added 7 added, so that a positive number is created. This number corresponds to the day of the week. To obtain in each case a positive number, you just replace the formula by use or by.

Explanation

The variable q flows with their actual value in the variable h for the weekday. More complicated is the integration of the month, the length of each month does not follow a uniform pattern. With the term, that is, the increase in the value m for the month to 1, the multiplication and subsequent rounding off, the non-uniform sequence of the length of the months in each formula is incorporated generally valid. The term accounts for the year and to be inserted in the century preceding the relevant year leap days. Both formulas differ only in the last term, which takes into account the leap year each with different arrangements of these two calendar systems.

Examples

To illustrate two examples:

1 On which day of the week was born Frederick II of Prussia (24 January 1712)?

The values ​​are: q = 24, m = 13 ( January is considered the 13th month of the previous year ), J = 17, K = 11 ( The month of January will be treated as belonging to the previous year. ) The following applies:

Frederick II of Prussia was born on a Sunday.

2 On which day Christopher Columbus discovered the New World (12 October 1492)? ( Since the date is prior to the introduction of the Gregorian calendar, here's the formula for the Julian calendar is used. )

The values ​​are: q = 12, m = 10, J = 14, K = 92 The following applies:

Christopher Columbus arrived on a Friday in America.

Use in mental arithmetic

Zellers congruence can also be used for the determination of the weekday in the head. In order to handle the formula easier in mind, it can be somewhat simplified by the values ​​are calculated and learned by heart for the months of:

Instead of the second term re- calculate for each date, just the corresponding number is used according to the above table. Again, January and February are treated as belonging to the previous year.

Monitoring of results

A simple and safe method of checking the results shown represent perpetual calendar

835624
de