# Decoding Gauss' Easter Algorithm

In 1800, Gauss published this algorithm for computing the date of Easter in a given year $year$:

1. $a = year \mod 19$

2. $b = year \mod 4$

3. $c = year \mod 7$

4. $k = \lfloor year/100 \rfloor$

5. $p = \lfloor (13 + 8k)/25 \rfloor$

6. $q = \lfloor k/4 \rfloor$

7. $M = (15 − p + k − q) \mod 30$

8. $N = (4 + k − q) \mod 7$

9. $d = (19a + M) \mod 30$

10. $e = (2b + 4c + 6d + N) \mod 7$

11. Gregorian Easter is $22 + d + e$ March or $d + e − 9$ April

12. if $d = 29$ and $e = 6$, replace 26 April with 19 April

13. if $d = 28$, $e = 6$, and $(11M + 11) \mod 30 < 19$, replace 25 April with 18 April

I've tried my best to decode this formula, but it remains a complete mystery to me. It doesn't help that Gauss himself states:

Die Analyse, vermittels welcher obige Formel gefunden wurde [...], lässt sich daher freilich in ihrer ganzen Einfachheit hier nicht darstellen [...]

("It is not possible to present here the entire analysis that led to the above formula")

I would like to be able to derive this formula myself. How can I do that? I know Easter falls on the first Sunday following the first full moon in Spring, but how to go from there? Naturally, I would expect the numbers $7$ and $30$ to be involved given that we are dealing with dates here, but where do $19$, $13$, $6$ and $8$ come from?

• Very crudely, 235 lunar ("synodic") months is 19 calendar years. Hence there is a 19-year cycle, which is tracked by $a$. There is also a 4-year leap year cycle, which is tracked by $b$. There is a 7-year day-of-the-week cycle (other than leap years, it advances by one day each year), which is tracked by $c$. – vadim123 Aug 14 '14 at 6:16
• Also, for every $100$ years, we don't have a leap year (tracked by $k$) but for every $400$ years we do have a leap year (tracked by $q$). – Darth Geek Aug 14 '14 at 7:18
• I think your #11 should read Julian Easter instead of Gregorian Easter, and your #'s 11, 12 are the corrections required to convert from the Julian Calculation to the Gregorian. I have a version of Gauss' article published by von Zach in 1800 that may give a little more background than the version you have (at least, the 'it is not possible...' quote does not appear and all the variables are explained). I came to this question because I'm still trying to figure it out myself (including the translation difficulties), will post an answer if I succeed. – Circulwyrd Nov 27 '17 at 20:32

A lunar month begins with the new moon and is 30 days long if the moon falls in a odd month (Jan, Mar, May, Jul, Sep, Nov) and 29 days long if the moon falls in an even month (Feb, Apr, Jun, Aug, Oct, Dec). As an exception, if the year has a leap day that day is added to the moon of February, so that in that year the moon of February lasts 30 days. So 12 lunar months are 354 days long in ordinary years and 355 in leap years. In both case the difference between the solar year and 12 lunar months is 11 days.

If you take count of these 11 days a year, after 19 years you have a difference of 19 x 11 = 209 days.

So in the ancient greek lunar calendar they added to the lunar calendar an extra month (called embolysmic month) when the difference was 30 or more. So if we start with year 1 (difference at the end of the year: 11), in year 2 that difference is 22, in year 3 it would be 33 but you add an extra month of 30 days so the difference becomes 3, and so on.

Adding 6 embolysmic months of 30 days each in 19 years the difference of 209 becomes 209-6 x 30=29 days, so you add another embolysmic month of 29 days to the nineteenth year and the difference goes to zero. That is, with 235 lunations (12 lunar years of 12 months each + 7 lunar years of 13 months each) you cover 19 solar years and all the moons of the year come back at the same days.

This is known as the Methonic cycle.

The difference between the solar and lunar year N is the same that the age of the moon at Jan, 1 of the year N+1.

If you have a moon at Jan 1st, the lunar year will end on day 354 of the year (355 if it's a leap year), that is on Dec, 20 and next lunar month begins on Dec., 21. So the age of the moon at Jan., 1 is 32-21=11 that is the same as the difference of year N.

The age of the moon at Jan 1st is called "epact" and its value is 0 to 29.

When you know the epact of a year, you know all the moons of that year too.

As for the Methonic cycle all moons repeat after 19 solar years, if you assign a number 1 to 19 to each year (this is called the Golden number) then all years with the same Golden numbers have the same epact and the same moons.

About 500 A.D. a monk, Dyonisus, stated that in the year before the one of Christ's borning there had been a moon at Dec, 24 so the moon's age of the subsequent year (1 B.C.) is 32-24=8.

So Dyonisus decided that the Methonic cycle would begin at year 1 B.C. with golden number 1 and epact 8.

The Golden number of every year Y after 1 B.C. is then

G = (Y mod 19) + 1

If you know the Golden number, you can easily find the epact, remembering thet the epact raises 11 days each year and if it reaches or is more than 30 you must subtract 30.

As you can see, after year 19 to reach year 1 of the next cycle you must add 12 and not 11 days, this is known as saltus lunae and the reason is that the embolysmic month of the nineteenth year of cycle has 29 days and not 30.

The relation between the Golden number G and the epact E can be expressed with a formula:

E = [8+11 x (G-1)] mod 30

E = (8+11G-11) mod 30

E = (11G – 3) mod 30

As 30+n = n mod 30 you can subtract 30 to the previous expression getting

E = (11G-33) mod 30

And, finally,

E = [11(G-3)] mod 30

If you know the epact of a year, you can find all the lunations of that year. In particular, as the lunar months of January and February count 59 days together, when the epact of the year is 0 that means that there is a lunation on Jan, 1 and another on day 1+59, that is on day 60 of the year, that is on 1 March.

Now, you know that the full moon of Easter is the first full moon that occurs on the day of equinox (that the Church fixed on March, 21) or after.

It was also stated that, for simplification purposes, the full moon of a lunar month is always the fourteenth day of that mont, that is 13 days after the new moon.

So when epact is 0 we have a full moon on 1+13=14 of March.

As March, 14 is before the equinox, we must consider the next full moon that, being the lunar month of march 30 days long, occurs on 13 april, that is the 44th day from March,1.

So, finally, when epact is 0 the paschal full moon is the day 44 of March, considering for calculation purposes as the dates of April would be dates of March+31.

When the epact raises by 1, the age of the moon is more and then the preceeding full moon is earlier, so all new and full moons shift a day back. So when epact is 1 the pfm is on day 43, when it is 2 is on day 42, and so on.

We can write

P = 44 – E

Where P is the paschal full moon.

But if E = 24 or more, the preceeding relation gives a paschal full moon earlier than the equinox. So in that case we must shift on the next full moon, adding 30 days.

So the correct formula is

P = 44 – E if E ≤ 23

P = 74 – E if E > 23

As the pfm is not before March, 21st, we can rewrite the equations as

P = 21 + 23 – E if E ≤ 23

P = 21 + 53 – E if E > 23

Now we can observe that 53 – E = (53 – E) mod 30 = (23 – E) mod 30 so the final formula is:

P = 21 + (53 – E) mod 30

Before affording Gauss’ algorithm, we need another step.

The methonic cycle, on which the last formula is based, works from 46 B.C. when the Julian calendar was instituted onto 1582 A.D. when Pope Gregory XIII stated the new calendar that after his name is called Gregorian. For reasons that is unnecessary to indicate here, the calendar reformation stated:

1) To realline civil and astronomical equinox on 21 March, 10 days had to be subtracted to 1582, so that the day after Thursday Oct, 4 1582 of the Julian calendar is Friday Oct, 15 of the Gregorian Calendar;

2) For next centuries, only secular years (the years ending with 00) multiple of 400 would be leap, the other ones would be ordinary (so called solar equation)

3) The lunar year would have been increased by 8 days every 2500 years, adding a day every 300 years for seven times, then a day after 400 years. The first day would have been added to 2800 as the last year of a cycle of 2500 and then another cycle began. The days to add until 1582 were determined to be 4 (so called lunar equation)

4) For effect of what here said, the epacts would have been diminished by 6 (4-10) as subtracting a day to a solar year diminishes the epact, adding a day to the lunar year increases it. Clavius, one of the astronomers in Pope’s commission, decided to decrease the epacts by 7, that way not altering the week cycle. So to determine epacts the days subtracted by the solar equation and the one added by the lunar equation are to be considered as these equations would be applied even before 1582.

All those rules can be formalized modifying the equation that gives us the epact as follows:

E = [11(G-3) + S – L] mod 30

Where S and L indicate, respectively, the solar and the lunar equation.

## The Gauss Algorithm

Gauss didn’t explain his algorhitm, but it can be easily derived from epacts and golden numbers.

First we give the meaning of the parameters d and e. The value d represents the number of days (0 to 29) that occur from 21st of March and the paschal full moon. The value e represents the number of days (0 to 6) that occur from the day after the paschal full moon, that is the first day in which Easter can fall, and the Easter Sunday.

So the date of Easter is given by 21+ d (pfm) + 1 (first day for Easter) + e (days to the first Sunday):

Date = 22 + d + e of March

If 22 + d + e is over 31, then you subtract 31 and gain the date of Easter in April:

Date = d + e - 9 of April

There are two exceptions that we’ll say later of.

Now to determine the value of d we can use the equations for epact and golden number. Remembering that epacts change in Gregorian calendar for the influence of solar and lunar equations, we first calculate d for the years 1700 to 1799 and the we will extend in general the formula to years before and after.

So if d are the days from March 21st to the full moon, we can write

d = P – 21 = 21+(53–E) mod 30 – 21 = (53 – E) mod 30

Now remembering that

E = [11(G-3) – S + L] mod 30

If we take

a = Y mod 19

we have

G = Y mod 19 +1 = a + 1

For the years 1700 to 1799 we can get the solar and lunar equations as follows:

k = |N/100| = 17

S = k – |k/4|= 17 – 4 = 13

L = |(8k + 13)/25|= 5

So we get

E = [11(a +1– 3) –13 + 5] mod 30 = (11a + 11 – 33 – 13 + 5) mod 30 = = (11a – 30) mod 30 = 11a mod 30

Now substituting E in the equation for d we get

d = (53 – E) mod 30 = (53 – 11a) mod 30 = (23 – 11a ) mod 30

d = (19a + 23) mod 30

To get a general equation for all Julian and Gregorian years, we substitute the number 23 with a parameter, that Gauss calls M.

Obviously, for the years 1700 to 1799 M = 23.

So, in general

d = (19a + M) mod 30

M raises by one each time you apply the solar equation, as in this case epact is one less and symmetrically full moon is a day later.

M also diminishes by one when the lunar equation is to be applied, because in this case the epact is one day more and the full moon one day before. So to determine the value of M for the Gregorian centuries you get

M=23 for 1700 to 1799

M=23 for 1800 to 1899 because in 1800 you apply either solar and lunar equations and the variations compensate one another

M=24 for 1900 to 2199, as in 1900 you apply the solar equation, in 2000 you don’t apply the solar neither the lunar equation and in 2100 you apply both.

For 1583 to 1699 M=22 because in 1600 no one euqtion is to be applied and after the application of the solar equation in 1700 M is 23.

For the years up to 1582 no equation is to be applied, but we must count the 7 days subtracted to epacts in 1582. This means that from the Julian 1582 to the Gregorian one epacts are 7 day less, and so M is increased by 7 days. This correction takes on count 12 days for the solar equation and 5 days for the lunar equation applied since 1 B.C. to 1582. That is, M for 1582 (and all Julian years before) is 22-7=15.

To get M for Gregorian years, it’s sufficient to calculate the solar and lunar equation and add the result to 15, subtracting 30 if the result is more as M occurs in an equation in modulo 30.

M=(15 + k – |k/4|–|(8k+13)/25|) mod 30

Now once you have a, d and M you must find e.

At this purpose, Gauss at first found a day that he knew to be a Sunday, that is March, 21st, 1700.

Then he calculated the number of days passing from March, 21st, 1700 to the Easter Sunday of a year Y between 1700 and 1799, observing that obviously that number of days should be a multiple of 7.

So the equation is initially that:

365 (Y – 1700) + i + (22 + d + e) – 21 = 0 mod 7

where:

365 (Y – 1700) + i are the days passed from March 21, 1700 to March, 21, Y, counting 365 days per year plus i leap days;

22 + d + e is the date of the Easter Sunday of year Y.

Now, for leap days, we have that the last leap year not after Y is given by

Y – Y mod 4

and then from 1700 to that year we have

Y – 1700 – Y mod 4

years. Calling b the quantity Y mod 4 we have that there are

Y – 1700 – b

years from 1700 to the last leap year not after b. hence there are

i = (Y – 1700 – b)/4 leap days from 1700 to Y

As i is an integer, 7i is an integer too and is a multiple of 7. So we can add 7i to the equation and get

365 (Y – 1700) +8i + (22 + d + e) – 21 = 0 mod 7

Substituting the value we found for I we have:

365 (Y – 1700) +2(Y – 1700 – b) + d + e + 1 = 0 mod 7

That is

367 (Y – 1700) – 2b + d + e + 1 = 0 mod 7

As 364 mod 7 = 0 we can subtract 364 (Y – 1700) and get

3(Y – 1700) – 2b + d + e + 1 = 0 mod 7

That is

3Y – 5100 – 2b + d + e + 1 = 0 mod 7

And adding 5096 that’s a multiple of 7

3Y – 4 – 2b + d + e + 1 = 0 mod 7

3Y– 2b + d + e – 3 = 0 mod 7

Now let c = Y mod 7. Then 3c = 3(Y mod 7) = 3Y- 3 x 7|Y/7|

Since 7|Y/7| is a multiple of 7, we can say

3c = 3Y mod 7

And substituting

3c– 2b + d + e – 3 = 0 mod 7

Finally, to eliminate minus signs, we subtract both members to 7c+7d, that is a multiple of 7.

(7c-3c)-(-2b)+(7d-d)-e-(-3) = 0 mod 7

4c+2b+6d-e+3 = 0 mod 7

Hence

e = (2b+4c+6d+3) mod 7

The number 3 that occurs in this equation is only valid for the years 1700 to 1799; to get a general formula we call that number N

e = (2b+4c+6d+N) mod 7

and calculate it as follows.

For 1700 to 1799 obviously N = 3

Each time the solar equation applies the days of the year shift one position back and so if 22+d+e indicated a Sunday, after the correction it occurs on Saturday and so you need another day to reach a Sunday. That’s why e must increase by one each time you apply the solar equation. And as the other parameters b, c and d are fixed for each year, the only parameter that can vary is N.

So we have that N is 3 for century 17, 4 for century 18, 5 for centuries 19 and 20, 6 for 21 and so on.

For century 16 N is 2 because in 1700 the solar equation is to apply.

For gregorian century 15 N is also 2 as in 1600 we don’t apply the solar equation

For years before 1583 N doesn’t change, but we must take count of the 10 days added to 1582, so N for the Julian calendar is (2-10) mod 7 = 6. In general, for Gregorian years you have that N = (2 + S – 12) mod 7 = (k – |k/4|–10) mod 7

N = (4+k – k –|k/4|) mod 7

For the two exceptions, they derive from the rule that

1) The paschal full moon can never occur on 19 April, so in the years with epact 24 the pfm has to be determined as the epact was 25;

2) In the same golden cycle you must not have two pfm the same day. So if in a cycle you have an epact 24 that becomes 25, when another epact 25 occurs that is to be considered as 26.

In both cases, the pfm is shifted back a day.

As for the algorhitm, thus, this shift is indifferent until e is less than 6, because the effect of shifting back the pfm (i.e. d becomes 1 less) is to diminish e by 6 mod 7, that is e increases by 1.

So if e before the change is 0 to 5, it becomes 1 to 6 and compensates the reduction by 1 of d, so that Easter’s date remains the same. But if e is 6 before the change, after the change it becomes 0 and then d+e drops by 7 and Easter date is shifted to the previous Sunday. So the first condition for the exceptions is that

e = 6

The first exception occurs when epact is 24. This means that

d = (53 – E) mod 30 = 29

So the first exception occurs when

d = 29 and e = 6

The second exception occurs when epact is 25 (and so d = 28) and in the same golden cycle there was an year with epact 24. This means that between the two years the epact is increased by 1 mod 30 So we have, if x is the number of years between the one with epact 24 and the one with epact 25:

11x mod 30 = 1

with x integer and 1 < x < 18

The only solution of that equation is x = 11 and so the second year must have a Golden Number not less than 12, or that the second year has a Golden Number greater than 11.

As a = G – 1 this condition can also be expressed as a > 10

The condition (11M+11) mod 30 <19 originally indicated by Gauss is equivalent to a > 10.

So, the conditions for the second exception are:

d = 29 and e = 6 and a > 10

and that’s all.

I did a version with australs.

You suppose the day is divided into 19 australs, and that there are 570 australs in the month. So what we do is calculate in which austral the moon falls in, what day it is, and then the sunday thereafter.

The gauss version is actually wrong. The ccorrect alculation and commentary is given in O'Breine's book "Puzzles and Paradoxes". The correct form was published by an anomynus new york correspondant to the Nature in 1876. This program replicates that method.

QBASIC does not read the command line, so we save it to an environment variable, and pull it into s$. =========EASTER.BAT======== @echo off set qbascmd=%1 c:\save\dos\qbasic /run L:\save\cdata\batch\easter.bas set qbascmd= ==========EASTER.BAS======== s$ = ENVIRON$("QBASCMD") DEF fnddv (y, x) = INT(y / x) yr = VAL(s$)
bb = fnddv(yr, 100): cc = yr MOD 100: aa = yr MOD 19
dd = fnddv(bb, 4): ee = bb MOD 4
gg = fnddv(8 * bb + 13, 25)
hh = (19 * aa + bb - dd - gg + 15) MOD 30
gm = fnddv(aa + 11 * hh, 319)
ii = fnddv(cc, 4): kk = cc MOD 4
gl = (2*ee+2*ii-kk-hh+gm+32) mod 7
t1 = hh - gm + 18
nn = fnddv(t1+71, 25)
pp = (t1 + nn) mod 32
print using "Easter Moon of #### is ##/##; yr, pp, nn
t1 = hh - gm + gl + 19
nn = fnddv(t1+71, 25)
pp = (t1 + nn) mod 32
print using "Easter Sunday of #### is ##/##"; yr, pp, nn,
SYSTEM
=======================================


In the above program, you get a print of the easter moon, and the following sunday.

Australs

As part of my investigation, i restructured this into something i can understand.

We calculate which austral the full moon falls in, there being 19 australs in the day, and 570 australs in the month. The australs are numbered from 0 on the 23 march, and count forward.

There are 235 lunar months in 19 years, or 12 full months and 7/19 parts. The year starts 7/19 months later, and thus the full moon advances 12/19 each year. That's 360 australs. The golden number and the day it falls on, can be found simply by doing (360 * year + c ) MOD 570, where c is some constant. This is the julian calendar, where the solar and lunar years are 365.25 days each. Note for this part, the leap year day is ignored.

The gregorian calendar adjusts the lengths of both years, to 365.2425 days and 365.2468 days respectively. This is done by droping a 3 leap years over 400 years, and adding 8 epacts (age of the moon at 1 jan) every 2500 years.

Each of these shifts occur on the century boundaries.

A day, or 19 australs is ADDED whenever a leap year day is deleted. This represents the fact that 19 australs that would have disappeardd on 29 feb are still around.

A day, or 19 australs, is SUBTRACTED, whenever there is a shift in the epact. The age of the moon is increased by a day, which takes the 19 australs.

The last three days are condensed into two, that the first day comprises of 27 australs, and the second of 30 australs.

if A > 513 then md = A div 30 + 10 ; else md = A div 19


The leap year australs are added, when the year is a multiple of 100, but not of 400.

The epact australs are subtracted, 8 times every 2500 years. This is what happens at gg in the program.

Because the easter month is rated at 29 days only, the last two days are taken to be 27 and 30 australs, rather than 19 days each.

Other calendars

Once this was understood, it helped devise easter days for other calendars. The simplest one runs like this.

1, The year starts on 1 march. The leap year day is new year's eve.

2, Years that give year mod 33 mod 4 = 3 are leap. The year makes 365.242424 days

3, An epact is added every 231 years, the luner year being 365.246753 days.

Alternately, a golden jump, by subtracting 30, equates to moving the moon to the next spot on the golden cycle. One adds 8 for each jump, which occurs every 363 years.

The lunar year here could be described as adding 19 leap year days every 77 years.

The exact periods, as of the current calendar, are

solar year = 'mean tropical year'
lunar year = 'mean tropical month' * 235/19


You get something like this:

 // is MOD   120 // 7 = 1
%  is DIV   120 % 7 = 17

austral =  (360*year + 304 + cor(year)) // 570
when austral < 513  /* lunae = date of full moon */
then lunae = austral % 19 + 21
else lunae = austral % 30 + 31
easter = day(lunae + 8) % 7 * 7  /* 7 | day(sunday) */

cor(year) is defined for calendar to calendar, as

julian:
cor(year) = 0
gregorian: /* 43 epact shifts in 10,000 years */
cor(year) = 19 * (year % 100 - year % 400 - (year % 100 * 8 + 13) % 25)
binary: /* 7 epact shifts in 1536 years */
cor(year) = 19 * ((year + 128) % 256 + year % 1536)
c33a:  /* 1 epact shift every 231 years */
cor(year) = 19 * ((year + 165) % 231)
elif:  /* 1 golden jump every 363 years */
cor(year) = 30 * ( year % 363)

• Please don't simply state that Gauss' algorithm is wrong without justifying the statement (I realize you quote a reference, but in itself this means little, at least to me: Who's to know that your reference is correct a priori?). Also, such statements as "As part of my investigation, i restructured this into something i can understand.", together with the poor writing throughout greatly diminish any confidence in your solution. – Circulwyrd Nov 27 '17 at 20:02
• For those curious about Gauss' error, here is an accessible reference: whydomath.org/Reading_Room_Material/ian_stewart/2000_03.html — "Unfortunately, Gauss’s work contained a minor oversight: it gives April 13 for the year 4200 when the correct date should be April 20" – jwd May 8 '18 at 0:54
• The basic program is straight from the O'Breine book that ian stewart refers to. So is that Gauss had an error in his work. – wendy.krieger May 8 '18 at 7:01