# Previous year like 2016

How can I find the previous year $y$ which was like 2016 in sense that January first is Friday, it has a leap year and date of Easters are the same on both years?

• You can use the process described here to find a leap year with the same YC. – Git Gud Oct 1 '15 at 17:06
• The answer is 1932 (and then 1864 and 1796), according to Mathematica, if that helps :P – Patrick Stevens Oct 1 '15 at 17:14

Mathematica brute-force program:

DayNumber[Monday] = 1;
DayNumber[Tuesday] = 2;
DayNumber[Wednesday] = 3;
DayNumber[Thursday] = 4;
DayNumber[Friday] = 5;
DayNumber[Saturday] = 6;
DayNumber[Sunday] = 0;

DayNumber[date_] := DayNumber[date["DayName"]]

EasterSunday[y_Integer] :=
Block[{paschal, golden, c, h, t},
golden = Mod[y, 19] + 1;
h = Quotient[y, 100];
c = -1*h + Quotient[h, 4] + Quotient[8*(h + 11), 25];
t = DayPlus[{y, 4, 19}, -1*Mod[11*golden + c, 30]];
paschal =
If[DayNumber[t] == 19 || (DayNumber[t] == 18 && golden > 11),
DayPlus[t, -1],
t];
DayPlus[paschal, 7 - DayNumber@DateObject[paschal]]]

Select[
#["DayName"] == Friday
&& LeapYearQ[#]
&& DateValue[EasterSunday[#["Year"]], "Day"] == 27
&& DateValue[EasterSunday[#["Year"]], "Month"] == 3
&]@(DateObject[{#, 1, 1}] & /@ Range[1800, 2016])

Returns 1864, 1932 and 2016.

January 1st is Friday on years 2016 and then subtracting 6, 11, 6, 5 years in sequence. (That is, 2016, 2010, 1999, 1993, 1988, 1982, 1971, 1965, 1954, …) This is because the day advances at the rate of one per year, except it advances twice if we are going into a leap year. This pattern continues until we hit 1900, which is an unexpected non-leap year and breaks the pattern.

Leap years, of course, are precisely those years divisible by 4 (to within experimental error). Since 2016 is divisible by 4, we're only going to hit a leap year every full cycle of 6, 11, 6, 5: subtracting 28 years each time.

Now the only thing left to consider is the Easter shenanigans. We need Easter in the years which are 2016 (mod 28): those which are divisible by 28.

We have an Easter-calculating algorithm available already - I'm using the one which Mathematica knows. All division is integer division throughout. It uses numbers $h = \text{year}/100$ (that is, 19 here, since we're hoping that there's an example in the 1900s), $c = -h + \frac{h}{4} + \frac{8(h+11)}{25}$ (which is $-6$ here), but then we can't do much more to simplify the calculations and I think we just have to brute-force through the four available years.