Wolfram Language

Compute the Date of Easter

The Wolfram Compiler can compile functions that accept and return arrays of numbers, not just numbers. The following function takes a beginning year and an end year and returns an array of {month, day} pairs of the date of Easter for each year in the range. The example also illustrates how the compiler supports a large number of integer mathematical functions, including Mod and Quotient.

The function easter implements Gauss's computus algorithm for the date of Easter. Compared to an uncompiled implementation, easter performs roughly 60 times faster on a 2018 MacBook Pro running macOS Mojave.

The compiled function can generate the dates for the years 1 through 5.7 million in a couple of seconds rather than in minutes.

The shortest repeat period for Easter days is 5.7 million, as 1 is the only divisor of the period that produces repeating patterns.

Visualizing the number of occurrences of each Easter date over the repeat period reveals a relatively flat, asymmetrical and non-normal distribution.

Related Examples