When will Ramadan fall across 3 months?

Date: 5 Mar 1995 07:50:34 -0500
From: D. Albert Szilak
Subject: Calendar problem
Here's the problem & answer. How is the answer obtained?
What's the proof? This year the Muslim holy month of Ramadan
fell across 3 months of the western calendar. It began 31 Jan &
ended 1 Mar. Each month in the Islamic calendar has exactly 30
days. The beginning of Ramadan each year moves back 11 days
in the western calendar. So next year it will begin 20 Jan. 1996
is a Leap year. Question is, when will Ramadan again fall across
3 months? In other words, when again will it begin on 31 Jan in
a non-leap year? Answer I have is after 719 years, in 2714?
What's the calculation look like?
D. ALBERT SZILAK {"YAM"} KFUPM,KSA
FACN35c@SAUPM00 {BITNET}

Date: 7 Mar 1995 13:40:02 -0500
From: Dr. Ken
Subject: Re: Calendar problem
Hello there!
Do you know how modulo arithmetic works? It consists of
looking at the remainders upon division by the base. So if
we're doing arithmetic modulo 5, for example, all the
following act exactly the same: 2,7,12,17,22,..., and all the
following are the same: 16,11,6,1,-4,-9,-14,.... If we add 4
and 3 modulo 5, we get 7, which is congruent to 2, so
4+3==2 (Mod 5). I'll use the symbol == to mean "is
congruent to." Modulo arithmetic is a pretty useful
technique to use in certain problems (like this one!).
How does it apply here? Well, we want to find out when the
first day of Ramadan will fall on the 31st day of the Gregorian
calendar. So we want to add 365-11 a bunch of times (to see
where Ramadan will fall the next year), and see when the
remainder upon division by 365 is 31. So we'd want to solve
the congruence equation 31 + n(365 - 11)==31 (Mod 365) for
n, i.e. 31 + 354n ==31 (Mod 365).
That will give us n, the number of years from now (in the
Islamic calendar) until Ramadan falls on the 31st of January.
Actually, that's the simplified version. See, leap year gets in
there and muddles it up. For the sake of this problem, let's
assume leap year occurs every 4 years, with complete
regularity, because I don't know offhand when the
irregularities are. So our regular cycle, starting with this year,
has 1 year with 365 days, then 1 with 366, then 2 with 365,
for a total of 1461 days in a complete cycle. Then we want to
find out which days in this cycle are desirable for the
beginning of Ramadan to fall on, (31, 762, 1127) and solve
the new congruences:
31 + 354n == 31 (Mod 1461)
31 + 354n == 762 (Mod 1461)
31 + 354n ==1127 (Mod 1461)
That's pretty much how you would solve it. Of course, we
didn't take into account the irregularities in the leap year
schedule, so we're going to be off. But this is the technique,
anyway.
-Ken "Dr." Math