INFINITY CALENDAR THEORY

ON

JULIAN & GREGORIAN CALENDAR


Yumnam Kirani Singh

Computer Vision and Pattern Recognition Unit.
Indian Statistical Institute, Kolkatta
email: kiranisingh@hotmail.com
Introduction
 Julian Calendar and  Gregorian Calendars are undoubtedly, the two most commonly used calendar types in the world. In Julian Calendar a year has 365.25 days and in Gregorian a year has 365.2425 days. Julian Calendars was first used and then Gregorian Calendar came to use later. For more details about  Julian Calendars and Gregorian Calendars, how Gregorian calendars come to use, and which country adopted it on which date, etc readers are referred to the sites http://www.tondering.dk/claus/calendar.html, http://www.norbyhus.dk/calendar.html, http://www.norbyhus.dk/calendar.html, http://hermetic.magnet.ch/cal_stud.html.
We are addressing here mainly the issue of deciphering the day of a particular date a year in  Julian as well as in  Gregorian Calendar. If one has an Infinity Calendar (Julian & Gregorian), written by Yumnam Kirani Singh, finding the day of a particular date can be done easier.
The difficulty in deciphering the day of a particular date using our classical or normal way is known to everybody. For deciphering a day of a given date, the knowledge of the day of another  date is required. Then, one has to count the number of days from a particular given date upto the specified date and is to be divided by 7, and find the remainder. Here, the most erroneus part is the counting of the days, as we have to take into accounts of not only the types of the years, whether it is a leap year or a non-leap year but also of the different numbers of days for different months. There are other techniques as an alternative to the classical method, but they are table based, one has to refer to a table, just as we do multiplication using logarithmic table. One such type is the perpectual calendar initiated by Pope Gregory.
Some Definitions and properties:
Leap year: A leap year  has 366 days.
Property: The 31st December  falls on the following day of the 1st January in a leap year.
Non-leap Year: A non-leap year has 365 days.
Property: The 1st January and the 31st December fall on the same day in a non-leap year.
Calendar types:
There are fourteen different types of calendars corresponding to the 7 different days of a week and two different types of years as given in the following Table.
 
New Year Day Non-Leap Year Leap Year
Sunday A H
Monday B I
Tuesday C J
Wednesday D K
Thursday E L
Friday F M
Saturday G N

Table-1: Types of Calendars.
In the above table, we simply classify all non-leap year calendars whose new year day falls on sunday as type-A calendars. Similarly all leap year calendars whose new year day falls on sunday is classified as type-H Calendars. There can't be calendar types in Julian and Gregorian Calendar other than these 14 types. All calendars, that has been used in the past, using at present or to be used in the future should be one of them.
Julian Calendar
In Julian Calendar any year number divisible by 4 is a leap year calendar. A calendar repeats after every 28 years, irrespective  of its type i.e., regardles of being it a leap year or non leap year.But a non leap-year calendar repeats 3 times in 28 years and the pattern of repeation is as follows.

All types of calendars can be generated from a cyclic sequence of 28 calendars. All types of Julian calendars can be generated from the following sequence.
 S1=[G,A,B,J,E,F,G,H,C,D,E,M,A,B,C,K,F,G,A,I,D,E,F,N,B,C,D]
The sequence S1 is periodic sequence with period 28. That is, if the calendar type of a year Yr is given by S1(Yr), then S1(Yr)=S1(Yr+28).

How to find types of a Julian Calendar of a year?
Let Yr be a year number in A.D, then the type of of the Julian calendar is given by S1(t), where t=Yr%28. The symbol x%y denotes the remainder when x is divided by y.
So, the procedure of finding the type of the Julian Calendar of a year in A.D is as follows.
1) Find t, the remainder of the year (number), when divided by 28.
2) Find S1(t), the t-th type from the sequence S1.

Example-1. On which day, the new year fell in 1745 A.D. in Julian Calendar?
We know Yr=1975, t=Yr%28=9. So the Calendar type of the 1745 A.D in Julian calendar is given by S1(9), that is C. C means that new year 1745 fell on Tuesday.
Thus we can find easily the new year day of any year in A.D in Julian Calendar.

Relation Between months:

Once you know the new year day of a year, you will be able to find the day of any particular date in the year as usual. But a new and easy way of finding the day of a particular date is introduced here. We define two sequences known as Month Key values; one for non-leap year and the other for leap year.

Month Key Values (Non-Leap Year)
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
0 3 3 6 1 4 6 2 5 0 3 5

Month Key Values (Leap Year)
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
0 3 4 0 2 5 0 3 6 1 4 6
Note here that the Month key values of a leap year after february are obtained from the Month key values of the non leap year by adding 1 to the month key values after february and finding the remainder of 7. The months having the same month key values beign on the same day as shown in the foolwing table.
 

For a Non-Leap Year   Beginning on For a Leap Year
Jan,Oct 1st January Jan, Jul, Apr
May 2nd January October
August 3rd January May
Feb, Mar, Nov 4th January Feb, Aug
June 5th January March, Nov
Sep, Dec 6th January June
Apr, Jul &th January Sep, Dec

How to find the day of a particular date in Julian Calendar?

For finding the day of a particular date in the year, the month key value of the corresponding month is added to the given date and the remainder of 7 is found out. Then the day is found out by counting the the days from the new year day of the year.
Let D-M-Yr be the Date-Month-Year representation of a particular date and K be the month key value of the corresponding month M. Then, the day corresponding to the date D-M-Yr is the I-th day, counting from the new-year day of the year.
where I=(D+K)%7.
In case I=0, it is the previous day of the 1st January of the year.
So for finding the day of a particular date, we have to know two things: 1) New-year day of the year and 2) the month key value.

Example-2: Find the day corresponding to 14 July 1745 in Julian Calendar.

We know, from example-1, that the new year day of 1745 fell on Tuesday. Since 1945 is a non-leap year, the month key value of July is 6, i.e., K=6. Then we find I=(14+6)%7=6. Begining counting from Tuesday, the sixth day is Sunday. That is, 14 July 1745 was Sunday.
Thus we can easily find the day of any date in Julian Calendar.

Gregorian Calendar:
In Gregorian Calendar, a year has around 365.2425 days. So, the concept every year (number) divisible by 4 is a leap year is wrong in Gregorian Calendar and hence a slight modification is required. For the modification to take place, let us define a century year. A century year is a year, whose year number can be expressed as a multiple of 100. For example, the years 200, 800, 1700, A.D etc are century years. Leap year modification is done on the century years in gregorian calendars. In Gregorian calendar, any non-century  year whose year number is divisible by 4 or any century year whose year number is divisible by 400 is a leap year. Because of this modification, we cannot form a continuous sequence of calendar types with period 28 as in Julian Calendar. If we form a sequence of calendar types in Gregorian calendar, it exhibits discontinuty when for each change in century. But within a century, it has the periodicity of 28. In general a Gregorian Calendar has periodicity of 400. In 400 years, we have 4 centuries, hence to know sequences of  Gregorian calendars, we define four modes correponding to each century.
A mode m of a year Yr in Gregorian calendar is defined as m=q%4 where q is the quotient when Yr is divided by 100.
Thus we have four modes, mode-0, mode-1, mode-2 and mode-3 corresponding to the four possible values of m. Every mode has its corresonding sequence with period 28 within a century. The sequnece of one mode can be obtained from the sequence of other mode. The mode-0 sequence is given by
S0=[B,C,D,L,G,A,B,J,E,F,G,H,C,D,E,M,A,B,C,K.F,G,A,I,D,E,F,N]
The sequence of other modes can be found from the mode-0 sequence from the following relation.
Sm(n)=S0(P)
where P=(n+4m)%28. Value of m are 0,1,2,and 3.
For example, if m=1, then we get S1 from S0 from the above relations.
S1=[G,A,B,J,E,F,G,H,C,D,E,M,A,B,C,K,F,G,A,I,D,E,F,N,B,C,D]
This is the sequence used in the Julian Calendar. Note that,  there is no  need of defining mode in Julian Calendar.
Now we can find the Gregorian Calendar type of any non-century year in A.D.
Procedure for finding the type of a non-century year in Gregorian calendar:
1. Find the quotient q and the remainder r when the year Yr is divided by 100.
2. Find m=q%4 and n=r%28
3. If m=0, then find S0(n) will give the type of the calendar.
4. If m is not equal to 0, find P=(n+4m)%28, S0(P) will give the type of the calendar.
Example-3:
What was the Calendar type of 1876? i.e, on which day new year of 1876 fell?
Step-1: We find  q=18, r=78.
Step-2: We get, m=18%4=2, and r=76%28=22
Step-3: m is not equal 0, hence P is calculated as P=(22+8)%22=2
S0(P)=S0(2)=C.
That is the type of the calendar is C. That is, the the new year of the 1876 was Tuesday.
How to find the Calendar type of a century year in GregorianCalendar?
In Gregorian Calendar, the type of the century year has to be determined separately because all century years are not leap year. The following table gives the type of the calendars of each century year corresponding to the four modes.
 
Mode of century year  Calendar Types
0 N
1 F
2 D
3 C
Tabe-Calendar Types of the century years.
Example-4. Which day was 1st January 2000A.D. in Gregorian?
The mode of the year 2000 is 0. Hence 2000 had N type Calendar. That is, the 1st January 2000 A.D was Saturday.
How to find the day of a particular date in Gregorian Calendar?
The procedure is almost the same as that described in the case of Julian Calendar. It involves the following steps.
1) First find the type of the Gregorian Calendar corresponding to the year.
2) Find I=(D+K)%7, in the same way as described in Julian Calendar.
The I-th day is the day of the corresponding date.
Example-5:Find the day corresponding to 25th July 1945 in Gregorian Calendar
Step-1: Finding the type of the Gregorian Calendar in 1945
q=1945/100=19, r=1945%100=45
mode of corresponding year m=q%4=19%4=3 and n=r%28=17
Since m is not equal to 0, we find P =(n+4m)%28=(17+12)%28=1
Hence the type of the Gregorian Calendar in 1945 is given by S0(P)=S0(1)=B.
That is, 1st January 1945 was Monday.
Step-2: Finding I.
Since 1945 was a non-leap year, the month key value of July is 6, i.e., K=6. We know D=25, the given date.
Then I=(D+K)%7=(25+6)%7=31%7=3.
Counting from Monday, the 3rd day is Wednesday.
That is, 25th July 1945 was Wednesday.
Example-6: Find the day corresponding to 27th September 2002.
We get m=0, n=2.
Since m=0, the type of Calendar of 2002 is given by S0(n)=S0(2)=C. That is, 1st January 2002 was Tuesday.
Since 2002 is a non-leap year, the month key value of September is 5, i.e, K=5.
D=27, the given date, hence I=(27+5)%7=32%7=4.
Counting from Tuesday, the 4th day is Friday.
That is, 27th September 2002 falls on Friday.


General Formula

Let S=[2 3 4 5 7 1 2 3 5 6 7 1 3 4 5 6 1 2 3 4 6 7 1 2 4 5 6 7]
Julian Calendar
I=(Date+S((Year%28+4)%7)+KeyValue(Month)-1)%7
Gregorian Calendar
For Century Years
C=[7 6 4 3]
I=(Date+C((Year/100)%4+1)+KeyValue(Month)-1)%7
For Non-Century Years
I=(Date+S(((Year%100)%28 +4*Mode)%7)+KeyValue(Month)-1)%7

Then Find the Day According to the Following Table
I=1 I=2 I=3 I=4 I=5 I=6 I=0
Sunday Monday Tuesday Wednesday Thursday Friday Saturday

I hope, from the above examples and formulas, one will be able to Decipher the Day of any given date (of any year in A.D) in both Julian and Gregorian Calendar easily. This theory of making Infinity Calendar can also be extended for any other types of Calendars.

Simplest The Best Algorithm for Finding the Day corresponding to a Date in Julian or Gregorian Calendar.


Required Input
(D for Date, M for Month, Yr for Year, T for type
T=1 means Julian, otherwise  Gregorian)
INPUT D, M, Yr , T
 S=[2 3 4 5 7 1 2 3 5 6 7 1 3 4 5 6 1 2 3 4 6 7 1 2 4 5 6 7]
Day=["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"," Friday", "Saturday"]
 C=[7 6 4 3]
 K=[0 3 3 6 1 4 6 2 5 0 3 5]
IF (Yr%4 EQUAL 0) OR (Yr%400 EQUAL 0)
 K=[0 3 4 0 2 5 0 3 6 1 4 6]
ENDIF
IF T EQUAL 1
 R=Yr%28
 P=(R+4)%7
T1=S(P)
ELSE
 R=Yr%100
 m=(Yr/100)%4
 n=R%28
P=(n+4*m)%7
T1=S(P)
IF R EQUAL 0
T1=C(m+1)
ENDIF
 I=(D+T1+K(M)-1)%7
PRINT Day(I)
 
 

Any comment or criticism is always welcome. Feel free to ask me if you have any doubt. Also any body who is interested to have a copy of INFINITY CALENAR (JULIAN & GREGORIAN) can cantact me. My email: kiranisingh@hotmail.com