Mathematics of the Jewish Calendar/The calculation of the Molad
The starting point
According to tradition, there was a Molad at exactly 14 hours (i.e. 8am) on the Friday of Creation, the time that Adam was created. Projecting the current rule back to that date, it follows, since Rosh Hashana cannot fall on a Friday (see later), that the following day was not only the first Shabbat but the first Rosh Hashana. This is regarded as Rosh Hashana of Year 2, since the six days of creation must belong to some year, which is designated as Year 1.
Working backwards, the previous Molad of Tishri was on a Monday, i.e. Day 2, at 5 hours and 204 chalakim. (With days from midnight to midnight, this is actually 11 hours 204 chalakim on Sunday pm.) Writing 2, 5, 200, 4 in Hebrew characters gives us BeHaRaD, so this is known as Molad BeHaRaD. It is also sometimes called Molad Tohu ("without form"), since it occurred while the world was still "without form and void" (Genesis ch.1). The date of this molad, and of Rosh Hashana for Year 1, would have been Monday 7 September 3761 BCE in the Gregorian calendar (7 October in the Julian one). (Note: when working with dates BCE, remember that there was no year 0; 1 BCE was immediately followed by 1 CE. Thus, the interval from say 1 June, 5 BCE to 1 June, 5 CE is only nine years, not ten.)
The date and time of each Molad, or time of New Moon, is computed by adding the standard interval 29 days, 12 hours, 793 chalakim to the date and time of the previous one.
If you are only interested in the day of the week and time of the molad, you can discard four weeks or 28 days and just add 1 day, 12 hours, 793 chalakim. If the result is 8 days or more, subtract a week.
The Molad of Tishri
Only the Molad of Tishri is of importance in computing the calendar. Thus, for fixing the calendar, it suffices to start from the Molad of Tishri and add on 12 times the length of the standard interval (i.e. 354 days, 8 hours, 876 chalakim) if it is an ordinary year and 13 times the length of the standard interval (i.e. 383 days, 21 hours, 589 chalakim) if it is a leap year.
Again, if we are only concerned with days of the week and times, we can discard 50 and 54 weeks respectively to get 4 days, 8 hours, 876 chalakim and 5 days, 21 hours, 589 chalakim.
The calculation may begin from any known molad, and to save time if we want a date many years from the known molad, we can add the molad for a 19 year cycle, 6939 days, 16 hours, 595 chalakim or, discarding complete weeks, 2 days, 16 hours, 595 chalakim.
Use of the other Molads
The Molads of the other months do have significance in determining whether the ceremony of blessing the New Moon may be performed. There are many rules and customs about this, but in particular it is not generally performed until at least 72 hours after the time of the Molad, to ensure that the Moon will be clearly visible. It must not be performed more than 14 days, 18 hours, 396 chalakim after the Molad, since after that time (half a chalak short of exactly half way from one Molad to the next), the Moon is regarded as waning and not waxing.