We’re just going to some high place so we can see clearly, and at that high place you may be able to see the top, you may be able to see other new particles. But really, the idea is you’re trying to get up somewhere where you think you can see more clearly than you are right now. So I’d love to discover the top quark, but that’s not why I’m doing this. I just want to get to that place, and look around.
—Melissa Franklin^{1}
The 819day count of the Mayan calendar comprises the three factors 7, 9 and 13, taken from smaller recurring cycles; the zero day (or starting point) of each 819day sequence, known as an 819day station, moves through the tzolk’in and haab in a pattern that is mathematically determined, with each station changing color and direction. Since the pattern’s behaviour may be described using just a few rigorous mathematical rules, the 819day count may be viewed as a “finite automaton,” a term taken from computer science. Because tzolk’in and haab positions combine to form a mathematical coordinate in the Calendar Round, it is possible to use the Calendar Round position and the 819day position to retrieve Long Count dates. This is due to the fact that the Calendar Round and 819day count form a 1,195,740day cycle, or 3,276 haabs. In this paper, I show computational methods for determining Long Counts from Calendar Round plus 819day counts and methods for determining 819day stations from Long Count dates, without resorting to full conversion to base 10 as do other methods. I describe new methods of computation based on modular mathematics, an area with useful applications to Mayan calendrics, using the Python programming language, which has a many features making research into Mayan mathematics particularly convenient. In the conclusion, I suggest some directions for future research.
Beauty comes always from the singularityof things.
—David Pye^{2}
Recently, I tried to win an argument with my wife, regarding the date of the upcoming election day, by saying, “Now, who knows more about calendrical matters, you or me?” She responded without hesitation, “I do, of course. After all, I’m married to a calendar expert, and you certainly can’t make that claim, can you?” I retreated.
The 819day count of the Mayan calendar is a ritual cycle that repeats endlessly; every 819 days, the cycle reaches what is known in the literature as a station, or, sometimes, resting place. The station can be defined as the moment when three other cycles are at specific points; these three smaller cycles are the thirteen numbered days, the Nine Lords of the Underworld and the Seven Lords of the Earth. The smallest possible commensurating cycle of these three factors (7, 9 and 13) is 819, because the three factors have no common divisor other than 1. As represented on Classic monuments, the count is represented as a distance number from the last previous station, the glyphs indicating the coordinates in the Calendar Round of the station so reached, and (often) a color/direction pair. A measure of the importance of the 819day count can be realized by observing the amount of visual real estated occupied by the glyph set on Classic monuments. One can assume that the energy required to lay out and carve stone monuments would not be wasted on trivial ritual markers, but only upon matters of secular or religious significance. At the same time, it is notable that there are only 15 monuments known with 819Day inscriptions upon them, indicating that many factors, including political and power dynamics, contributed to the choice of whether or not to commit the 819Day phrase to stone.
The three factors represent cycles of differing ritual importance for Mayans, judging from their relative presence on Classic monuments. Thirteen is, of course, the trecena (in the same sense that score stands for a unit of twenty, trecena means a unit of thirteen). The trecena and the Mayan phrase Oxlahun ti ku (“thirteen holies”) undoubtedly stand for the gods of the first thirteen numbers, or the Lords of the Day (Thompson, 1971). Since the trecena is present on virtually every single Classic monument, we can assume that it is of major importance.
Nine represents the nineday cycle of the Lords of the Night, also known by the Mayan phrase Bolon ti ku (“nine holies”). In Mayanist circles, it is known as “Glyph G of the Lunar Series” (Thompson, 1929), even though the cycle has nothing to do with the Lunar glyphs. Most monuments contain glyphs referring to this cycle; for the most part, the names of these nine Lords of the Night are unknown (but see Frumker, 1993). Relative importance can be assumed to be generally equivalent to that of the trecena.
Seven, as Yasugi and Saito (1991) have shown, appears to indicate a cycle of seven “Lords of the Earth,” indicated in the inscriptions by “Glyph Y” of the Lunar (or Supplementary) Series. Although there is no evidence in the Books of Chilam Balam for this, so far as I know, a Mayan phrase similar to the previous two would be Wuk ti ku, or “seven holies.” Yasugi and Saito list only 22 monuments displaying glyph Y, not too many more than show the 819day count, and thus the importance of this cycle may be judged to be markedly less than the other two.
It is widely known among Mayanists that Glyph G may be used to help reconstruct Long Count dates from Calendar Round dates; given a Calendar Round and a Lord of the Night glyph, Long Counts may be located accurately within Classic Mayan time. Nine is not a factor of the Calendar Round, so we can determine the minimum cycle of the G glyphs and the Calendar Round by simply multiplying 9 · 18,980, which is 170,820 days, or 468 haabs; a bak’tun is only 144,000 days. Those who have used some of the widely available computer programs that help determine imprecise Mayan dates will remember that all occurrences of any given Calendar Round within a bak’tun have differing glyph G positions, and that each additional Calendar Round gives a reduction by one in the glyph G position, due to the fact that division of 18,980 by 9 yields a remainder of 8. Because most Mayan dates occupy the 9th bak’tun, with very few falling outside that range, it is ordinarily not difficult to convert vague dates into accurate ones.
Yasugi and Saito’s research into the Lords of the Earth, or Glyph Y, cycle shows that Y glyphs could also be used in the same way, although not over so long a time scale. Seven is also not a factor of the Calendar Round, so the Calendar Round and the Y glyphs together make a 132,860day cycle, as 7 · 18,980 = 132,860, or 364 haabs. Because division of 18,980 by 7 gives 3 as a remainder, the addition of a Calendar Round to any date makes the glyph Y position increase by three (or decrease by four, depending upon mathematical convenience). It is possible to have two dates in a bak’tun with coincident Calendar Rounds and Y glyph positions. While the number of Long Count dates having associated G glyphs far exceeds those with Y glyphs, the possibilty of increasing temporal specificity using the sevenday Y glyph cycle is nonetheless a distinct one.
Since the Calendar Round and the 819day count share thirteen as a factor, this eliminates garnering additional information from the trecena over and above what one already has from the Calendar Round. In fact, if one has an 819day position, the positions in the subsidiary seven, nine and thirteenday cycles may easily be extracted from it; no additional date information may be found from the three subcycles and the 819day count. Therefore, the seven, nine and thirteenday cycles are (mathematically) interesting insofar as they permit reconstruction of either Long Count dates or 819day positions. Inscriptions bearing 819day counts usually offer an additional coordinate, however: that of color/direction, which permits resolution to 3,276 days, as there are four colors and four directions. The color and direction covary (are locked together), and, since four is not a factor of 819, the pattern results in a 3,276day cycle (Kelley, 1976).
Even though the 819day count combines the three ritual cycles of seven, nine and thirteen days into one larger cycle, day 0 of the 819day count does not begin on the zero (or first) points of the three subcycles. While the first point in the glyph G cycle is occupied by G1, day 0 of the 819day count is set to G6; it is also position 1 in the trecena, when you might think that it would be set to 10 (to correspond to the G6 position). Day 0 is also set to seven in the glyph Y cycle (Yasugi and Saito explain that this position in the Y cycle could be viewed as either 0 or 7, i.e., the cycle could run either 0 to 6 or 1 to 7. Since they have not found a Y glyph with a numerical coeffecient for this position, they have arbitrarily chosen to refer to it as 7, mimicking the pattern of the trecena). An 819day station of 0 therefore corresponds mathematically to (Y7, G6, T1), or to use modular notation (discussed later), to (0,6,1).
The inscriptional phrase, found in varying locations in date clauses on Classic monuments, opens with a distance number counting back to a station, followed by some form of the T588 verb. Thompson (1971), who first noted its existence in the inscriptions (1943), has described the 819day count as a “Soulless Mechanism,” while Barbara MacLeod (1989) demurs, calling it “A Soulful Mechanism.” Since it is a mechanism governed by specific, mathematical rules, I prefer to refer to the cycle as a “finite automaton.” This term, taken from computer science, simply indicates that the mechanism’s state, past, present and future, can always be calculated, given any other state; In fact, the whole automaton may be described solely in terms of such rules, as I intend to show in what follows.
The elementary mathematics of the 819day count have been known since Thompson’s (1943) work, with Kelley’s (1976) work adding much to it, but only recently have there been any advancements in understanding the meaning of the cycle. The only indication of the significance of the count in Mayan spiritual life has been the amount of graphical real estate lavished upon it in monuments, and this has not been an informative indication. Approaching our own, Gregorian, calendar from the perspective of future archaeology, we might view our own ignorance of the importance of the 819day count as similar to knowing that Easter is important in the Gregorian calendar, but being unable to determine its significance. In recent Western times, Christmas has occupied more “visual real estate,” so to speak, than has Easter; future epigraphers might be justified in missing the facts that the date of Easter determines the entire ritual calendar of the Catholic church for the coming year, that the accurate calculation of Easter is therefore tremendously important, and that Christmas is hardly a blip on the ecclesiastical radar screen. Our knowledge of the meaning of the 819day count might conceivably be on a par with knowing only that Easter had something to do with something or someone “getting up.”
The 819day count has not been found in the codices, although the verb is there; because T520 (ok) is infixed into T588, MacLeod (1989) advanced a tentative translation of the verb as e¢ok, “plant the feet.” Note also T1022 , which is quite similar to T588, lacking only the “sprout” affix. She notes, however, that T588 is frequently suffixed by T178 (la) and T181 (halah); these suffixes have led to Linda Schele’s reading of this verb as walah, “to place” or “to seat” (Schele and Grube, 1997). Schele’s paraphrase of the glyphs is “on suchandsuch a day, or so many days since that day, God K seated (or stood up) something.” Although this translation leaves much to be desired, my aim in this paper is not to offer any additional illumination on the meaning of the phrase but to attempt to reveal the full complexity of the cycle’s mathematics.
The phrase will sometimes close with a “One RodentBone” glyph, or T758/T757:T110: MacLeod’s tentative translation of the “onerodentbone” glyph was hun ch’ok, “one offspring” or “one sprout.” It is one of the alternate forms of Glyph B, where T758 is ch’o and T110 is ko.
The tzolk’in and haab glyphs for the 819day station come either after the distance number (cf. Yaxchilan L30) or, as in some examples from Palenque, in the position otherwise occupied by T757/T758. The most complete and complex examples do seem to come from Yaxchilan; a specific example is Lintel 30, E3F6. Here, in addition to the distance number (E3E4), T588 (E5), the direction (F5), the color (E6) and the “RodentBone” (F7) glyphs, we have two additional glyphs: the “beetle,” or Glyph Y (F6) T739, and a “Smoking Squirrel”/God K T1030 glyph (E7). Yasugi and Saito (1991) suggest that T1030 with the T122 prefix , represents the thirteen celestial deities (oxlahun ti ku), that T739 may represent the seven terrestrial deities (wuk ti ku?) and that another glyph, which they describe as “a head glyph of a deity or a geometric glyph with X sign infixed,” might possibly be read as bolon ti ku, the nine infernal deities. I have not, however, been able to determine exactly to which glyph this last reference may be.
In at least three examples, again all from Yaxchilan, there is an additional glyph with a numerical coeffecient of 6 , a form of T540/T541 (Yaxchilan L29, C4; Yax. 1, C8; Yax. 11, D15(?)), associated with the Calendar Round date; since G6 is the Lord of the Night for all 819 stations, Thompson (1943, 1971) speculated that this might be a form of the G6 glyph, which would be fortunate, as we have only one other example of G6 in the corpus. Yasugi and Saito (1991), however, cast doubt on Thompson’s choice for G6, and suggest a form of the Y glyph in its place.
A listing of inscriptions containing 819day stations is given in Appendix I.
Berlin and Kelley (1961; Kelley, 1976) have shown that each 819 day station is referenced to (or under the control of) a different direction/color; since there are four directions and corresponding colors, the 819Day Count is usually said to have 3,276 days, adding the ritually important number 4. Each trip through the 819day cycle decrements color and direction by one, and the color and direction may be determined solely on the basis of the veintena day. The mathematics are detailed below, but the pattern for colors (at each successive station) is: red (chak), yellow (k’an), black (ek) and white (sak). The directions are locked to the colors, following the pattern: east (likin), south (nohol), west (chikin) and north (xaman).
Mathematically, we usually consider the 819 day count, or cycle, as beginning on day 3 of linear time, 1 Kaban 5 Kumk’u. As Lounsbury (1978) points out, this is merely a convenience, not a necessity, as we do not know which possible starting point the Mayans may have used (I will have more to say on this topic later in the paper). Because 819 is evenly divisible by thirteen, the trecena day for each 819 day station is a constant and is always one. And since 819 is one less than an even multiple of 20, the veintena decrements by one on each increment of the cycle; so too do the color and direction, as noted above. Since there are twenty veintena days, that means that it takes twenty 819 day cycles, or 16,380 (Mayan 2.5.9.0) days, for the same veintena day to recur. The position in the tzolk’in (Δtz) shifts by 39 days each station, in the following pattern:
819Day Cycle  Days Elapsed  Days Elapsed, Mayan  Tzolk’in Position (Δtz)  Tzolk’in  Color  Direction 

0  0  [0, 0]  156  1 Kaban  Chak (Red)  Likin (East) 
1  819  [2, 4, 19]  195  1 K’ib  Kan (Yellow)  Nohol (South) 
2  1638  [4, 9, 18]  234  1 Men  Ek (Black)  Chikin (West) 
3  2457  [6, 14, 17]  13  1 ’Ix  Sak (White)  Xaman (North) 
4  3276  [9, 1, 16]  52  1 Ben  Chak (Red)  Likin (East) 
5  4095  [11, 6, 15]  91  1 ’Eb  Kan (Yellow)  Nohol (South) 
6  4914  [13, 11, 14]  130  1 Chuwen  Ek (Black)  Chikin (West) 
7  5733  [15, 16, 13]  169  1 Ok  Sak (White)  Xaman (North) 
8  6552  [18, 3, 12]  208  1 Muluk  Chak (Red)  Likin (East) 
9  7371  [1, 0, 8, 11]  247  1 Lamat  Kan (Yellow)  Nohol (South) 
10  8190  [1, 2, 13, 10]  26  1 Manik’  Ek (Black)  Chikin (West) 
11  9009  [1, 5, 0, 9]  65  1 Kimi  Sak (White)  Xaman (North) 
12  9828  [1, 7, 5, 8]  104  1 Chik’chan  Chak (Red)  Likin (East) 
13  10647  [1, 9, 10, 7]  143  1 K’an  Kan (Yellow)  Nohol (South) 
14  11466  [1, 11, 15, 6]  182  1 Ak’bal  Ek (Black)  Chikin (West) 
15  12285  [1, 14, 2, 5]  221  1 ’Ik’  Sak (White)  Xaman (North) 
16  13104  [1, 16, 7, 4]  0  1 ’Imix  Chak (Red)  Likin (East) 
17  13923  [1, 18, 12, 3]  39  1 ’Ahaw  Kan (Yellow)  Nohol (South) 
18  14742  [2, 0, 17, 2]  78  1 Kawak  Ek (Black)  Chikin (West) 
19  15561  [2, 3, 4, 1]  117  1 ’Etz’nab  Sak (White)  Xaman (North) 
20  16380  [2, 5, 9, 0]  156  1 Kaban  Chak (Red)  Likin (East) 
We can immediately see, then, that the 819Day count must be at minimum 16,380 days long, not merely 3,276 days. From examples of contrived numbers, we have good evidence that the Mayans knew about this specific cycle. The distance number that links Pakal’s birth on 9.8.9.13.0 8 ’Ahaw 13 Pohp with the initial date on the Tablet of the Cross at Palenque is 9.8.16.9.0, which is 83 of these 16,380 day cycles (1,660 of the 819day counts) (Lounsbury, 1978).
The haab and the 819day count also form a repeating cycle, due to the fact that the haab position (Δh) shifts by 89 days on each increment of the count. Since 819 and 365 do not share a common divisor other than one, it necessarily takes 365 trips through the count for the haab day 5 Kumk’u to recur. The extreme length of the cycle, 298,935 days, is simply the product of 365 · 819; every position in the haab is visited on some 819day station. A table showing all 365 positions in the haab is provided as Appendix II.
The minimum possible period for the 819Day Count must then be 298,935 days, or Mayan 2.1.10.6.15. However, one trip through this 365haab cycle will still not return us to day 1 Kaban of the tzolk’in, since 298,935 is not evenly divisible by 16,380 (there is a remainder of 4095). This suggests that there is a larger, recurring cycle which may be determined as discussed next.
The tzolk’in and the 819day count combine to form a cyle of 16,380 days, which is 20 · 819, or 63 · 260. The haab and the 819day count form a larger cycle of 298,935 days, which is 819 · 365. To reconcile the two cycles requires a larger cycle, which may have as factors 260, 365 and 819. 260 · 365 · 819 is 77,723,100 days, but we can reduce this by noting that, as is wellknown, 260 and 365 have a greatest common divisor of 5; these are factors of the Calendar round. The Calendar Round is only 18,980 days long instead of 94,900 due to the fact that we can divide either of these factors by 5 (our greatest common divisor) and multiply the result times the other factor to determine the maximal length. I.e., 260 / 5 = 52, 52 · 365 = 18,980 and 365 / 5 = 73, 73 · 260 = 18,980. We thus have every reason to believe that, rather than dealing directly with 260, 365 and 819, we can work with the 18,980 days of the Calendar Round (determining the greatest common divisor of three numbers is rather more work than we need to undertake), and it therefore seems likely that the Calendar Round and the 819Day count would have common factors. Indeed, this turns out to be the case as, not surprisingly, 18,980 and 819 share a greatest common divisor of 13. 18980 / 13 is 1460, and 1460 · 819 is 1,195,740 days, or Mayan 8.6.1.9.0. This is the same as 73 of the 20 · 819Day cycles; remember that for each 20 · 819day cycle, the haab position shifts by 5 days. It therefore takes 73 of the 5day shifts (73 · 16,380) for the same tzolk’in and haab combination to recur.
Finally, the greatest common divisor of 1460 and 819 is one, showing that the number we have arrived at is the smallest possible cycle commensurating the Calendar Round and the 819day cycle. To test this hypothesis, we can add our Mayan number, 8.6.1.9.0, to any reasonable Long Count date and determine the position in the 819day cycle (Δe) and the position in the Calendar Round (ΔCR):
0.0.0.0.0 4 ’Ahaw 8 Kumk’u, ΔCR = 7283, Δe = 3 + 8.6.1.9.0 8.6.1.9.0 4 ’Ahaw 8 Kumk’u, ΔCR = 7283, Δe = 3 
Similarly, the standard (convenient) starting point for the 819day count, 3 (three days before 0) or 1 Kaban 5 Kumk’u, with the addition of 8.6.1.9.0, becomes 8.6.1.8.17 1 Kaban 5 Kumk’u, with G6 as Lord of the Night; it is itself an 819day station.
We can suppose that using the two coordinates Δe and ΔCR, it would be possible to determine positions within such a larger cycle of 1460 · 819 = 1,195,740 days. Clearly, this would be advantageous, as it would mean that given an 819day count position or station and a Calendar Round date, we would be able to determine a Mayan date within 3,276 haabs. Given one additional piece of information, say the bak’tun, the date could be pinpointed within a much larger timeframe. Not having a better name at hand, I will refer to the 3,276 haab cycle as E.
In the next section, I will cover conventional means for performing 819Day calculations, using adaptations of standard techniques as explained in Lounsbury (1978) and again in Lounsbury (n.d.), and following that, the calculation of 819Day stations using only Long Count coefficients without the necessity of converting to decimal numbers. Next, I will describe new methods using modular arithmetic as applied to the same calculations; finally the reconstruction of Long Counts from Calendar Round and 819Day stations is described. Many of my calculations were done directly in Mayan arithmetic (or a close simulation), using a package that I wrote in the Python programming language, which is available for Microsoft, Macintosh and Unix Operating Systems. Python functions are given for many operations in this paper; all of them are contained in a downloadable package.Appendix V: Python Resources includes some notes for obtaining, installing and using the Python Language. There are also instructions for obtaining and installing the mayalib package, which is the code for all the functions described in this paper.
It sounds like just normal stuff, and yet it’s something about the universe that’s incredibly hard to measure, hardly anyone does it, and it’s totally cool.
—Melissa Franklin^{3}
Most of the methods in this section are based on or adapted from Floyd Lounsbury’s, as described in “Formulae for Maya Calendrical Computations” (n.d.) and in “Maya Numeration, Computation, and Calendrical Astronomy” (1978). It will be useful to review here the symbols used in the previous pages (and introduce some more).
Symbol  Meaning 

G  The nineday cycle of the Lords of the Night, 19 
Y  The sevenday cycle of the terrestrial gods, 17 
T  The thirteenday cycle of the celestial gods, the trecena 113 
v  The twenty named days, the veintena ’Imix’Ahaw 
c  One of the four colors red, yellow, black and white 
d  One of the four directions east, south, west, north 
tz  The tzolk’in, 260 days, T · v 
Δtz  Distance between two positions in the tzolk’in 
h  The haab, 365 days 
Δh  Distance between two positions in the haab 
hd  The haab day, 019 
hm  The named haab month, PohpWayeb 
CR  The Calendar Round, 18,980 days, 260 · 73 or 365 · 52 
ΔCR  Distance between two positions in the Calendar Round 
e  The 819day count, G · Y · T 
Δe  Distance between two positions in the 819day count 
E  the 1460 · 819day count cycle, 1,195,740 days 
ΔE  Distance between two positions in cycle E 
m  The decimal equivalent of a Long Count date 
j  The Julian period day corresponding to m 
m8  An 819day station 
k  A k’in Long Count coeffecient 
w  A winal Long Count coeffecient 
Ordinary 819 day calculations are not particularly complicated, once you have the “Mayan Day” (m), i.e., the decimal equivalent of a Long Count date. Methods for the conversion of Long Counts to decimal numbers are quite common and will not be covered here. As an example, let us take the Long Count 12.19.4.12.0 9 ’Ahaw 18 Sak, which can be converted to decimal 1866480. Once this value is known, simply add 3 to it (1866483) and modulo^{4} it by 819:
Formula  Python  

Δe = (m + 3) % 819  def st8(m): st = (m + 3) % 819 return st 
for our example this is:
Δe = (1866480 + 3) % 819
Δe = 801
meaning that it is 801 days past the last 819 day station. Or, using Distance Number format, 1 K’in, 4 Winals, 2 Tuns (1.4.2). The actual day of an 819 day station, then, would be marked as 0 K’in, 0 Winal, 0 Tun, or Mayan 0.0.0, and the largest Distance Number you could possibly see would be 818, or Mayan 18.4.2 (2.4.18 in normal form).
To find the actual day of the 819 day station (m8), subtract the 819 day position (801 in our example above) from the date of the monument, m:
Formula  Python  

m8 = m  Δe
m8 = 1866480  801 m8 = 1865679  def fm8(m,de): return m  de 
The trecena for 819 day stations is always one; since 819 is evenly divisible by 13, and since we’re using three days before “zero” (4 ’Ahaw 8 Kumk’u) as a convenient base day, then 4  3 is 1.
The veintena can be found directly, by taking the 819 day station (m8) modulo 20:
Formula  Python  

v = m8 % 20
v = 1865679 % 20 v = 19 (Kawak) 
def fv(m8): return m8 % 20 
In the case of our base date, “three days before zero,” we can determine the trecena, veintena and haab with very little difficulty:
4 ’Ahaw (day 0) 8 Kumk’u  3 1 Kaban (day 17) 5 Kumk’u 
Determining the Lord of the Night for the base date is equally simple; for m 0, the Lord of the Night is G9, and three days before that would necessarily be G6. Thus, all 819 day stations are under the influence or protection of G6 (819 is evenly divisible by 9, of course). Using m = 1866480 from our example, the Lord of the Night (G) is most easily determined by taking m modulo 9 and substituting G9 for 0; Long Count positions are not required with this method.
Formula  Python  

G = m % 9
G = 1866480 % 9 G = 6 
def fG(m): return m % 9 
Another method for finding the Lord of the Night that depends on the winal and k’in positions of the Long Count is as follows:
Formula  Python  

G = ((w · 2) + k) % 9  def flcG(w,k): return ((w * 2) + k) % 9 
The next station, at m 816, would be:
1 Kib (day 16) 9 Sots G6
Once m for the 819 day station (m8) is known, then we can find the tzolk’in position using this formula:
Formula  Python  

Δtz = (m8 + 159) % tz  def ftz(m8): return (m8 + 159) % 260 
We add 159 because the tzolk’in does not start on day 0 (4 ’Ahaw 8 Kumk’u) of the Long Count, but on 1 ’Imix, and 4 ’Ahaw is day 159. So, for our example,
Δtz = (1865679 + 159) % 260
Δtz = 1865838 % 260
Δtz = 78
And then, with the tzolk’in position, we can easily find both the trecena and veintena:
Formula  Python  

T = (Δtz + 1) % 13  def fT(dtz): T = (dtz + 1) % 13 if T == 0 : T = 13 return T 
(We add 1 because day 0 in the tzolk’in is 1 ’Imix; our modulo function in this case does not return 0, but for other positions in the tzolk’in, a return value of 0 should be replaced with 13.)
T = (78 + 1) % 13
T = 1
And 1 is exactly what we expect and require.
For the tzolk’in position, we may use the following formula.
Formula  Python  

v = (Δtz + 1) % 20  def fV(dtz): return (dtz +1) % 20 

v = (78 + 1) % 20 v = 19 v = Kawak 
(We add 1 here also, because ’Imix is day 1 and ’Ahaw is day 0.)
Once we know the position in the tzolk’in, we can derive the color and direction very easily:
Formula  Python  

c = Δtz % 4
c = 78 % 4 c = 2 (Black) 
def fCD(dtz): return dtz % 4 

d = Δtz % 4 d = 78 % 4 d = 2 (Chikin [West]) 
The color and direction may be found by looking up the value found by applying our formula in the following table:
Index  Color  Direction  Veintena Days  

0  Chak (Red)  Likin (East)  ’Imix 1 
Chik’chan 5 
Muluk 9 
Ben 13 
Kaban 17 
1  Sak (White)  Xaman (North)  Ik 2 
Kimi 6 
Ok 10 
’Ix 14 
’Etz’nab 18 
2  Ek (Black)  Chikin (West)  Ak’bal 3 
Manik’ 7 
Chuwen 11 
Men 15 
Kawak 19 
3  Kan (Yellow)  Nohol (South)  K’an 4 
Lamat 8 
’Eb 12 
K’ib 16 
’Ahaw 0 
Again, once we know the Mayan day number of the 819 day station (m8), we can figure out the haab position using:
Formula  Python  

Δh = (m8 + 348 ) % haab  def fH(m8): return (m8 + 348) % 365 
We add 348 to m8 because the haab does not start on day 0 (4 ’Ahaw 8 Kumk’u) of the Long Count, but at 0 Pohp; 8 Kumk’u is day 348. For our example, the position in the haab would be:
Δh = (m8 + 348) % 365
Δh = 1866027 % 365
Δh = 147
Once this position in the haab is known, it’s almost trivial to find the haab month (hm) and day (hd):
Formula  Python  

hm = (int) Δh / 20
hm = 147 / 20 hm = 7 Mol (Pohp is month 0) 
def fHMD(dh): hm = dh / 20 hd = dh % 20 return (hm, hd) 

hd = Δh % 20 hd = 147 % 20 hd = 7 
Therefore, our haab is 7 Mol, giving a complete Calendar Round date of 1 Kawak 7 Mol. Note that the Python function defined above returns what is called a tuple (a pair or more of values). When using such a function in a program, an easy way to do so is:
hm, hd = fHMD(dh)
Which automatically “unpacks” the tuple, putting the answers into the correct variables (hm and hd).
The Calendar Round (CR) starts on a day 1 Kaban 0 Pohp and runs for 18,980 days to end on 13 ’Ahaw 4 Kumk’u. Day 0 (4 ’Ahaw 8 Kumk’u) of the Long Count, in this system, has a CR position of 7283. Lounsbury (n.d.) gives several formulae for determining the CR position, but the most direct way to calculate it is by taking m for the 819 day cycle modulo 18,980 (the length of the Calendar Round):
Formula  Python  

ΔCR = m8 % CR
ΔCR = 1865679 % 18980 ΔCR = 5639 
def fCR(m8): return m8 % 18980 
What we’re calculating here is not the absolute position but the distance from day 0. The absolute CR can be found by simply adding 7283 (remember from the above that day 0 of the Long Count, 4 ’Ahaw 8 Kumk’u, has a Calendar Round position of 7283):
Formula  Python  

ΔCR = 5639 + 7283
ΔCR = 12922 
def fCRa(m8): return (7283 + m8) % 18980 
For a fuller explanation of why this works, and to see Lounsbury’s more detailed formulae, refer to the Calendar Round Page. Once you have found the relative position in the Calendar Round, you can easily find the tzolk’in and haab positions:
Formula  Python  

Δtz = (ΔCR + 159) % tzolk’in
Δtz = (5639 + 159) % 260 Δtz = 5798 % 260 Δtz = 78 
def fCRtzh(dCR): tz = (dCR + 159) % 260 h = (dCR + 348) % 365 return (tz, h) 

Δh = (ΔCR + 348) % haab Δh = (5639 + 348) % 365 Δh = 5987 % 365 Δh = 147 
The Python function again returns a tuple, the pair being (Δtz, Δh). These positions can, of course, be used above for finding the haab day and month, and for finding the trecena and veintena, as described above.
Using m8 found above, we can simply apply the standard techniques explained on the Long Count Page, that is, performing a sequence of modulo operations followed by divisions on the number of days to be converted until the number is zero.
For our example, we have m8 set to 1865679; in this case, our operations are:
Mayan  Position  Formula  Value  Result 

K’in  LC[0]  m8 % 20
m8 = m8 / 20 
LC[0] = 1865679 % 20 = 19
m8 = 1865679 / 20 = 93283 
19 
Winal  LC[1]  m8 % 18
m8 = m8 / 18 
LC[1] = 93283 % 18 = 7
m8 = 93283 / 18 = 5182 
7 
Tun  LC[2]  m8 % 20
m8 = m8 / 20 
LC[2] = 5182 % 20 = 2
m8 = 5182 / 20 = 259 
2 
K’atun  LC[3]  m8 % 20
m8 = m8 / 20 
LC[3] = 259 % 20 = 19
m8 = 259 / 20 = 12 
19 
Bak’tun  LC[4]  m8 % 20
m8 = m8 / 20 
LC[4] = 12 % 20 = 12
m8 = 12 / 20 = 0 
12 
LC = 12.19.2.7.19 
A Python function to perform the conversion is shown here:
m8 = 1865679 def fMLC(m8): lc=[] # Make an empty list i = 0 bs = 20 # Set the base of the current position while(m8 > 0): # While we’ve got work to do if i == 1: # If the position is the winal... bs = 18 # set the base to 18; else: bs = 20 # otherwise, set it to 20 t = m8 % bs # Calculate the Long Count coeffecient for this place lc.append(t) # Append the coeffecient to the list m8 = m8 / bs # Integer truncation; get rid of coeffecient i = i + 1 # Increment the position (place) index lc.reverse() # Put the list in the correct order, since we # started figuring it out from the smallest first return lc 
This function performs several tasks, and is valid for any number; that is, it will correctly convert any decimal number, no matter how large, into a Long Count of however many places are required. The comments (after the #) should give a good idea of what’s going on, and for the given example, the value returned is [12, 19, 2, 7, 19]; the [ and ] are Python notation for a list of values, which is a (very) convenient notation for Long Counts.
We find no vestige of a beginning, no prospect of an end.
—James Hutton^{5}
It is often useful to work with Long Counts directly without going through an intermediate conversion to a decimal value as we did above. It is not difficult, once a Long Count date is known, to calculate the positions in the haab and tzolk’in, and in fact the method for finding 819day positions described here is modelled on Lounsbury’s method for calculating the trecena position from Long Counts (Lounsbury, 1978, and Lounsbury, n.d.). He observed that the trecena coeffecient moved, forward or backward, directly according to the days passed. Each day that passed incremented or decremented the trecena by one, each winal incremented or decremented by 20, and so on. However, these shifts can be reduced by taking them modulo 13; therefore, the real shift for the winal is either 7 or 6, depending on which you prefer to use (the distance between the negative shift and the positive one must sum to 13), being equivalent. For tuns, the shift is either 9 or 4; for k’atuns, 11 or 2. This can be further simplified so that a table of all shifts, both positive and negative, need not be kept for all positions in the Long Count (bak’tuns, piktuns, and so on), but may instead be rather quickly calculated. He observed that, except for the tun position, each shift is 7 times the shift of the position to its right. In the tun position, the multiplier is 5 instead of 7.
A Python function to print out as many places of these shifts as are required is given here:
def print_trcoefs(n): i = 0 c = 7 q = 1 l = [] while(i < n): l.append(q) if(math.fabs(q) < math.fabs(q  13)): print “l[%d] = %d [[%d]] preferred: %d” % (i, q, q  13, q) else: print “l[%d] = %d [[%d]] preferred: %d” % (i, q, q  13, q  13) i = i + 1 if i == 2: c = 5 else: c = 7 q = c * l[i  1] q = q % 13 
And here is sample output from the procedure when n is 20 (l stands for Long Count position, where l[0] is k’ins, l[1] is winals, and so on):
l[0] = 1 [[12]] preferred: 1 l[1] = 7 [[ 6]] preferred: 6 l[2] = 9 [[ 4]] preferred: 4 l[3] = 11 [[ 2]] preferred: 2 l[4] = 12 [[ 1]] preferred: 1 l[5] = 6 [[ 7]] preferred: 6 l[6] = 3 [[10]] preferred: 3 l[7] = 8 [[ 5]] preferred: 5 l[8] = 4 [[ 9]] preferred: 4 l[9] = 2 [[11]] preferred: 2 l[10] = 1 [[12]] preferred: 1 l[11] = 7 [[ 6]] preferred: 6 l[12] = 10 [[ 3]] preferred: 3 l[13] = 5 [[ 8]] preferred: 5 l[14] = 9 [[ 4]] preferred: 4 l[15] = 11 [[ 2]] preferred: 2 l[16] = 12 [[ 1]] preferred: 1 l[17] = 6 [[ 7]] preferred: 6 l[18] = 3 [[10]] preferred: 3 l[19] = 8 [[ 5]] preferred: 5 
The l[n] notation is the same as shown above in Table 3: Conversion of m8 to Long Count. That is, l[0] indicates the trecena shift for the k’in position, l[1] indicates the trecena shift for the winal position, and so on. The preferred column simply lists the smaller of the two possible numbers; typically, the number used would be the smaller of the two just because it’s easier to perform arithmetic on paper with smaller multipliers.
We can make a similar set of observations regarding the 819Day Count. Each k’in that passes shifts the position by one day. Each winal by 20 days, each tun by 360 days. Each k’atun shifts by 7200, but this modulo 819 is 648; each bak’tun shifts by 675 days. Here is a table showing the shifts, but it only goes from l[0] (k’in) to l[13] (certainly more than will ordinarily be needed):
Long Count Position  Shift in 819Day Position for Each Unit 

l[0]  1 
l[1]  20 
l[2]  360 
l[3]  648 
l[4]  675 
l[5]  396 
l[6]  549 
l[7]  333 
l[8]  108 
l[9]  522 
l[10]  612 
l[11]  774 
l[12]  738 
l[13]  18 
Only l[0]  l[13] are listed, because the pattern starts to repeat: l[14] has the same shift as l[2], l[15] the same as l[3], and so on. If we treat the table of shifts as an array beginning with position l[2], we see that we can find the shift for any given l[n] by finding the shift value at index i, where
i = (n  2) % 12
unless n = 0, when i = 1, or n = 1, when i = 20. For each Long Count place, we simply multiply the coeffecient times the appropriate i, and modulo the answer 819. We add or subtract this to or from our conventional starting point, i.e., three days before zero, or 3 1 Kaban 5 Kumk’u.
As an example, let us take the Long Count 9.16.9.0.0. We can see that l[0] and l[1] are both 0, so they have no effect on the position in the 819Day Count. Therefore Δe, our position in the 819day count, remains at 3. For all the Long Count positions listed, we have:
l[0]  Δe = 3 (0 · 1 = 0) 

l[1]  Δe = 3 (0 · 20 = 0) 
l[2]  Δe = 3 + 783 ((9 · 360) % 819 = 783) 
l[3]  Δe = 3 + 783 + 540 ((16 · 648) % 819 = 540) 
l[4]  Δe = 3 + 783 + 540 + 342 ((9 · 675) % 819 = 342) 
Δe = 1668 % 819  
Δe = 30 
Therefore, for 9.16.9.0.0 5 ’Ahaw 8 Sip, our 819Day Count position is 30, meaning the last station was on 9.16.8.16.10 1 Ok 18 Pohp. To find the next station, simply add Mayan 2.4.19 to this date, which is 9.16.11.3.9 1 Muluk 7 Xul. The method also works for negative Long Count dates, since we only have to keep track of the distance from 3 1 Kaban 5 Kumk’u; to go back one station, we move 2.4.19, which is equivalent to zero, and we can see that our Long Count becomes 0.0.2.5.2 1 ’Etz’nab 16 Mak.
Following is a Python function to calculate the previous 819Day position from any size Long Count date. The input to the function, l, is a simple list containing Long Count coeffecients. Lists, in Python, are expressed as shown before: [ 9, 16, 9, 0, 0 ]. To make calculation inside the function easier, the list is reversed (rewritten so that it appears in the order [ 0, 0, 9, 16, 9 ]) so that larger components appear last instead of first (just the same way we converted m8 into a Long Count, above).
# Remember that we make special cases of k’in and winal. # Index 0 1 2 3 4 5 6 7 8 9 10 11 l819coefs = [ 360, 648, 675, 396, 549, 333, 108, 522, 612, 774, 738, 18 ] def f819st(l, sign): # List of LC coeffecients, sign is 1 or 1 l.reverse() # Put the k’in first. j = 0 e = 3 # 819 Day station for 0.0.0.0.0 for i in l: if j == 0: c = 1 elif j == 1: c = 20 else: c = l819coefs[(j  2) % 12] if sign > 0: e = (e + (i * c)) % 819 else: e = (e  (i * c)) % 819 j = j + 1 l.reverse() # Put back original order return e 
Suppose, however, that all we have is the position in the 819Day Count and the position in the Calendar Round, such as 5 ’Ahaw 8 Sip? Can we recover the full Long Count from these two data? Yes, we can, and that will be covered in the next section, after a slight detour.
There’s a saying attributed to Eichler that there are five fundamental operations of arithmetic: addition, subtraction, multiplication, division, and modular forms.
—Andrew Wiles^{6}
Anyone who has dealt with the Mayan calendar at all recognizes that modular arithmetic plays an important part in calendrical calculations. Math involving the tzolk’in, for example, uses modulo operations frequently, and calculations with the Calendar Round also require such math. Conversions to and from decimal integers require at least some facility in modular arithmetic. What may not be as widely known, however, is that such arithmetic has its own set of rules and that modular methods of representation find widespread application in the design of modern, parallel, computers, because multiplication of modular numbers can be far quicker than conventional methods. Addition, subtraction and multiplication of modular numbers is very simple, while division, comparison and positive or negative determinations are very difficult. Conversion of an integer number into its modular representation is fairly simple, but the reverse is not (Knuth, 1998).
A modular number is, basically, a list of r remainders that result from the division of a number, n, by rmoduli. Thus, the number 153 can be represented as (10, 13), where r_{1} = 13 and r_{2} = 20. The range of a modular number is just the product of the moduli, as long as such moduli have no common factors, and possible numbers in that range are 0 <= n < m (in other words, n can be any number from 0 through (r_{1} · r_{2})  1). In our example, the range is 260, since 13 · 20 = 260, and n can be 0 through 259. Since this is the tzolk’in, though, we have to make some small adjustments. Because the tzolk’in begins on day 1 ’Imix, we need to set position 0 equal to 1 ’Imix, and we do that by adding 1 to our position, which is 153 in our example. Therefore, to find the trecena, we take (153 + 1) % 13, and (as usual), replace 0 with 13 when our modulo function returns it. And we do the same with the veintena: (153 + 1) % 20. For the example, then, we represent our n as (11, 14), or 11 ’Ix. This should be quite familiar, and the tuple representation of modular numbers should also be familiar.
What, however, do we do when we wish to convert a modular representation such as 11 ’Ix, (11, 14), back into an integer—in this case, a position in the tzolk’in? The usual method is to apply this formula (Lounsbury, n.d.):
Δtz = 40[(tr_{2}  tr_{1})  (v_{2}  v_{1})] + (v_{2}  v_{1}) % 260 
But there is another method that we can use; according to Knuth (1998), it is possible to convert any modular representation back into an integer representation. He gives two general proofs, one intuitive and one better suited to computer science. He then demonstrates that while the second method will work, it demands far more computation than is practical. H.L. Garner in 1958 (Knuth, 1998) suggested an even better proof which is quite practical for computers, and, since Mayan arithmetic ordinarily deals with reentrant cycles comprised of only two factors (20 · 13, 52 · 365, etc.), can be adapted for hand calculation.
Garner’s generalized method, for only two relatively prime moduli, depends on a “magic number,” and is as follows:
v_{1} = u_{1} % m_{1}
v_{2} = ((u_{2}  v_{1}) · c_{12}) % m_{2} v_{r} = (v_{2} · m_{1}) + v_{1} 
Where m_{1} is the modulus of the first element in the list of coordinates that is the modular representation of integer v_{r}; m_{2} is the modulus of the second element. u_{1} is the first coordinate, u_{2} the second. c_{12} is a constant, or our “magic number,” v_{1} and v_{2} are intermediate values, and v_{r} is our answer, the reconstituted integer. We can use the same method on numbers represented by more than two coordinates, but it becomes very much more complicated, and there’s not a lot of point to it in Mayan arithmetic, as we really don’t need to find numbers from three coordinates, and when we do, we can break them down into their constituent parts. However, in Appendix IV, I do provide formulae demonstrating that it is possible, using the three factors of the 819day count, 7, 9 and 13; these formulae will allow you to determine 819day stations directly from trecena, glyph G and glyph Y coordinates (T, G and Y).
The key problem here, though, is finding the constant, or magic number, c_{12}. Again, we can find the answer in Knuth (1998), where he is describing Garner’s algorithm. Since our two moduli must be relatively prime, that is, share no common factors, that means that their greatest common divisor (gcd) must be 1. This can be computed, and in the process we can find our constant c_{12}, using an algorithm developed by the Hindu mathematician Bháscara I in the sixth century CE. It is a modification of Euclid’s algorithm for finding the greatest common divisor, and is referred to as the “Extended Euclidean Algorithm,” or, as it was called by other Hindu mathematicians, kuṭṭaka, or, “The Pulverizer.” Knuth’s description of the Pulverizer can be found in Appendix III, followed by its Python implementation.
The Python function exgcd() (described in Appendix V) is an extremely useful one. Since its main job is to determine the greatest common divisor of a pair of numbers, it becomes a valuable aid to determining factors of cycles in the Mayan Calendar. Its secondary job is to find, as a byproduct, a magic number suitable for use in Garner’s algorithm described above. Running the function on any two numbers will return a tuple of three numbers: the greatest common divisor; the magic number we need; and a second magic number that we do not need.
At this point, we can apply these principles to finding the position in the tzolk’in.
As stated above, we have a general method in the form of Garner’s algorithm for recovering a positional number from a modular number:
v_{1} = u_{1} % m_{1}
v_{2} = ((u_{2}  v_{1}) · c_{12}) % m_{2} v_{r} = (v_{2} · m_{1}) + v_{1} 
If we plug our moduli for the tzolk’in(13, 20) into the Pulverizer, we get gcd = 1 (as expected) and c_{12} = 3. Modifying the formula above, then, we can establish our formula for position in the tzolk’in (Δtz) to be:
v_{1} = (T  1) % 13
v_{2} = (((v  1)  v_{1}) · 3) % 20 Δtz = (v_{2} · 13) + v_{1} 
T  1 and v  1 are due to the initial position (0) of the tzolk’in being set at 1 ’Imix; and when v  1 is less than 0 we need to make v = 19. Taking our previous example of 11 ’Ix(11, 14), we can substitute and work our formula as follows:
Formula  Python  

v_{1} = (11  1) % 13
v_{1} = (10) % 13 v_{1} = 10 v_{2} = (((v  1)  v_{1}) · 3) % 20 v_{2} = (((14  1)  10) · 3) % 20 v_{2} = (((13)  10) · 3) % 20 v_{2} = (((3) · 3) % 20 v_{2} = ((9) % 20 v_{2} = 9 Δtz = (v_{2} · 13) + v_{1} Δtz = (9 · 13) + 10 Δtz = (117) + 10 Δtz = 107 Δtz = 107 + 260 Δtz = 153 
def p260(T, v): # T 113, v 119, 0 c12 = 3 m1 = 13 m2 = 20 u1 = T  1 u2 = v  1 if u2 < 0: u2 = 19 v1 = u1 % m1 v2 = ((u2  v1)*c12) % m2 dtz = ((v2 * m1) + v1) return dtz 
Which is precisely the answer we expect, and we can now apply these same principles to finding the position in the Calendar Round (ΔCR).
The same formula, with different magic numbers, can be used to recover any positional number from any set of two modular coordinates. The hardest part is determining our magic number, such as we require for the modular number that represents position in the Calendar Round (ΔCR). Our moduli are 260 and 73; we use 73 instead of 365 since 260 and 365 have 5 as the greatest common divisor, and 365/5 = 73, which then gives us the necessary greatest common divisor of 1. The Python function exgcd(260, 73) gives us the tuple (1, 16, 57), which is, as you recall, (gcd, magic # 1, magic # 2), and we are able to use 16 in our formula.
We can modify Garner’s algorithm to calculate ΔCR in this way:
Formula  Python  

v_{1} = (Δtz  156) % 260
v_{2} = ((Δh  v_{1}) · 16) % 73 ΔCR = (v_{2} · 260) + v_{1} 
def pCR(tz, hb): # tz = 0259, hb = 0364 c12 = 16 m1 = 260 m2 = 73 u1 = tz  156 if u1 < 0: u1 = u1 + 260 u2 = hb % m2 v1 = u1 % m1 v2 = ((u2  v1) * c12) % m2 dcr = ((v2 * m1) + v1) return dcr 
Again, remember that the beginning of the Calendar Round is set at coordinates (156, 0), or 1 Kaban 0 Pohp, which is why we subtract 156 from Δtz, and add 260 if it’s less than 0
As an example, we shall take the CR date of 1 Kawak 7 Mol, substitute and work the formula (although not in as much detail as previously). Δtz = 78, and Δh = 147:
v_{1} = (Δtz  156) % 260
v_{1} = (78  156) % 260 v_{1} = 182 v_{2} = ((Δh  v_{1}) · 16) % 73 v_{2} = ((147  182) · 16) % 73 v_{2} = 49 ΔCR = (v_{2} · 260) + v_{1} ΔCR = (49 · 260) + 78 ΔCR = 12922 
Which is what we expect. Finally, we are ready to tackle the full 819 · 1460 cycle (E) and, as a byproduct, establish a probable starting point for cycle E.
It is hardly possible for me to recall to the reader who is not a practical geologist the facts leading the mind feebly to comprehend the lapse of time. He who can read Sir Charles Lyell’s grand work on the Principles of Geology, which the future historian will recognize as having produced a revolution in natural science, and yet does not admit how vast have been the past periods of time, may at once close this volume.
—Charles Darwin^{7}
Our coordinates in this cycle are the position in the 819Day Count, Δe, and the position in the Calendar Round, ΔCR. The position in the 1,195,740 (Mayan 8.6.1.9.0) day cycle is termed ΔE.
As before, we plug our two moduli, 819 and 1460, into the Pulverizer (exgcd()), and find that our greatest common divisor is, of course, 1, and that c_{12} = 23. Thus, our formula for the position in cycle E is:
Formula  Python  

v_{1} = (ΔCR) % 1460
v_{2} = ((Δe  v_{1}) · 23) % 819 ΔE = ((v_{2} · 1460) + v_{1}) 
def pE(dcr, pe): # dcr = 018979, pe = 0818 c12 = 23 m1 = 1460 m2 = 819 u1 = dcr % 18980 u2 = pe % 819 m = m1 * m2 v1 = u1 % m1 v2 = ((u2  v1) * c12) % m2 de = ((v2 * m1) + v1) return de 
Cycle E begins when the Calendar Round position is 0, or 1 Kaban 0 Pohp, and the 819Day Count is also 0. We need to determine where that zero point falls in relation to Long Count day 0, and the best way to do that is to simply plug in the correct values for ΔCR and Δe that serve as coordinates of Long Count day 0. We already know that Δe = 3, and by simply substituting 4 ’Ahaw 8 Kumk’u into our previous algorithm for position in the Calendar Round, we can easily find that ΔCR is 7283. We can now apply our above formula to the coordinates (7283, 3) as follows:
v_{1} = (ΔCR) % 1460
v_{1} = (7283 % 1460 v_{1} = 1443 v_{2} = ((Δe  v_{1}) · 23) % 819 v_{2} = ((3  1443) · 23) % 819 v_{2} = 459 ΔE = ((v_{2} · 1460) + v_{1}) ΔE = ((459 · 1460) + 1443) ΔE = 671583 
If day 0 in the Long Count corresponds to day 671,583 in cycle E, we have now “calibrated” our algorithm. All we need to do to produce Long Count dates from it is to subtract 671,583 from whatever answer we get, and then take that result and convert into Long Count coeffecients by the usual methods.
By subtracting 671,583 from 0, we can also work out the beginning point of cycle E: 671,583 corresponds to the Long Count date 4.13.5.9.3 before the start of the current era (0.0.0.0.0 4 ’Ahaw 8 Kumk’u). The Calendar Round for this date is, of course, 1 Kaban 0 Pohp, which falls on Sunday, November 19, 4,952 Gregorian (using the 584285 correlation). This is, by the way, 87,297 days (239+ years) before the beginning of our own Julian Period^{8}, which we use to correlate the Mayan and the Julian calendars, and from there the Gregorian.
As a final note, it may be instructive to determine the length of time required for cycle E, combined with some other wellknown calendric cycles, to repeat. Since Y, G and T are all components of E, we really can’t extract any additional information from them. Colors and directions, of course, are also components, as is the Calendar Round. We need to look at cycles not incorporated directly into E, such as tuns, k’atuns and bak’tuns. At first glance, we might suppose that the tun, composed as it is of 18 winals, might repay examination. However, it turns out that 360 and E share a greatest common divisor of 180, and the smallest commensurating cycle is therefore:
cs = (E / 180) · 360
cs = 2391480 which is 2E. 
What this means is that a date with winal 0, k’in 0, Calendar Round 7283 (4 ’Ahaw 8 Kumk’u) and 819day position 3 recurs every 16.12.3.0.0 days (2,391,480 decimal, or 6,552 haabs). This is alignment on tun boundaries. If we up our standards a little bit, and require k’in, winal and tun to all be 0, then the repetition frequency goes up by a factor of twenty. Dates don’t recur for 16.12.3.0.0.0 days (47,829,600 decimal, 131,040 haabs). Increase the requirements to include k’atuns too, and it goes up by another factor of twenty: 16.12.3.0.0.0.0 (956,592,000 decimal, or 2,620,800 haabs). Increase yet again to include bak’tuns, another factor of twenty (we are now at a factor of 8,000) and we get: 16.12.3.0.0.0.0.0 days, 19,131,840,000 decimal, 52,416,000 haabs.
Let’s ask a different question. Remember the date at Coba? The one that reads 13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.0.0.0.0 4 ’Ahaw 8 Kumk’u? We know that this date is equivalent to 0.0.0.0.0 4 ’Ahaw 8 Kumk’u, and can therefore assume that the 819day station is 3 (it’s not shown on the monument). The question is, how many 13s does it take before the lowest five Long Count coeffecients are 0 (0.0.0.0.0), the Calendar Round is 4 ’Ahaw 8 Kumk’u, and the 819day count position is 3 again? This is a question with an answer on a very much larger scale than previously, where the largest cycle we found was about 52.4 · 10^{6} haabs. Here, we are starting with something that is the equivalent of 28.3 · 10^{27} haabs!
Is there an answer? One way to find out is to start with day 0, and start inserting 13s at the large end of the number. Admittedly, this is extreme brute force; but it does work. We start with 0.0.0.0.0 and our next step is 13.0.0.0.0.0, at which point we calculate that date’s position in cycle E; we continue inserting 13s, until we find a date where the ΔE again equals that of day 0, or the computer explodes. Well, there is an answer.
It turns out that if we keep inserting 13s until we have
72 of them, we end up with
13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.13.0.0.0.0.0 4 ’Ahaw 8 Kumk’u
This is 9,305,547,427,296,816,673,725,170,526,315,789,473,684,210,526,315,789,473,684,210,526,315,789,473,684,210,526,315,789,473,682,240,000 days or 25,494,650,485,744,703,215,685,398,702,235,039,653,929,343,907,714,491,708,723,864,455,659,697,188,175,919,250,180,245,133,376,000 haabs, and in the vicinity of 25.4 · 10^{96} years. This is a very large number; current estimates of the number of atoms in the entire universe range from 10^{70} to 10^{90}. It is not quite a googol, which is 10^{1010}, or 10^{100}; that is, 10 followed by 100 zeroes.
I suspect, however, that larger cycles exist within the framework of the Mayan calendar, and I hope to throw some light upon this subject in the future.
That was when I became very close to Taniyama. Taniyama was not a very careful person as a mathematician. He made a lot of mistakes, but he made mistakes in a good direction, and so eventually, he got right answers, and I tried to imitate him, but I found out that it is very difficult to make good mistakes.
—Goro Shimura^{9}
While I’ve covered some important techniques that may help simplify the narrowing down of inscriptional dates, I have also shown some new methods that can be applied to
Equally important, I think, should be the realization that modular arithmetic techniques may be used in many ways in Mayan calendrics, not merely in calculations involving the 819day count. The analytical methods used herein may also apply to other Mayan calendrical topics, thus removing the determination of some formulae from the realm of trialanderror. When I first determined the existance of the 1460 · 819day cycle, I did not think of researching Knuth’s books for assistance, instead spending a good bit of time trying to devise formulae based on Lounsbury’s for the minimum interval between Calendar Round dates. Only after failing miserably at this endeavor did I start looking at Knuth, and, once I found the topics and techniques I needed, it became clear that the hard part was over. I just needed to implement some functions in Python, plug in values, and out came answers suitable for direct use in other formulae, taken virtually unchanged from Knuth. I was lucky. I was able to make some good mistakes.
The only listing of all known 819Day dates is in (Kelley, 1976), but the distance numbers used to determine these stations are unfortunately not shown. Here is the list:
A  9.12. 4.13. 7  1  Manik’  10  Pohp  G6  0  Palenque, N. Tab. Temple XVIII 
B  9.13.16.10.13  1  Ben  1  Ch’en  G6  0  Yaxchilan L.29, L.30 
C  9.15.19.14.14  1  ’Ix  7  Wo  G6  0  Yaxchilan St. 11 
D  9.16. 8.16.10  1  Ok  18  Pohp  G6  0  Yaxchilan St. 1 
E  9.18.14. 7.10  1  Ok  18  K’ayab  G6  0  Quirigua St. K 
F  0. 0. 6.15. 0  1  ’Ahaw  18  Sots  G6  0  Palenque Temple of the Cross [as 12.19.13.3.0] 
G  9.17. 2.10. 4  1  K’an  7  Yax  G6  0  Copan T11, East Door South Panel 
H  9.10.10.11. 2  1  ’Ik’  15  Yaxk’in  G6  0  Palenque Palace Tablet 
I  9.18. 7.10.13  1  Ben  11  Sots  G6  0  Palenque IS Vase 
J  9.12.18. 7. 1  1  ’Imix  19  Ch’en  G6  0  Palenque TFC (South Jamb?) 
K  [no date]              Palenque Templo del Conde (N. Side, S. Pillar, Central Doorway) 
L  [no date]              Palenque Fallen Stucco Glyphs, Temple 4, N.) 
M  9.17. 4.15. 3  1  Ak’bal  16  K’ank’in  G6  0  Yaxchilan St. 4 
N  9.11.15.11.11  1  Chuwen  19  Pohp  G6  0  Palenque House A Pier A 
O  10. 1.13.10. 4  1  K’an  17  Sek  G6  0  Walter Randel Stela 
819Day Cycle 
Days Elapsed Eng. Mayan 
Long Count  Tzolk’in  Haab  Haab Position (Δh) 
819Day Cycle 
Days Elapsed Eng. Mayan 
Long Count  Tzolk’in  Haab  Haab Position (Δh) 


0  0  0.0  0.3  1 Kaban  5 Kumk’u  345  1  819  2.4.19  2.4.16  1 K’ib  9 Sots  69 
2  1638  4.9.18  4.9.15  1 Men  18 Mol  158  3  2457  6.14.17  6.14.14  1 ’Ix  7 Mak  247 
4  3276  9.1.16  9.1.13  1 Ben  16 K’ayab  336  5  4095  11.6.15  11.6.12  1 ’Eb  0 Sots  60 
6  4914  13.11.14  13.11.11  1 Chuwen  9 Mol  149  7  5733  15.16.13  15.16.10  1 Ok  18 Keh  238 
8  6552  18.3.12  18.3.9  1 Muluk  7 K’ayab  327  9  7371  1.0.8.11  1.0.8.8  1 Lamat  11 Sip  51 
10  8190  1.2.13.10  1.2.13.7  1 Manik’  0 Mol  140  11  9009  1.5.0.9  1.5.0.6  1 Kimi  9 Keh  229 
12  9828  1.7.5.8  1.7.5.5  1 Chik’chan  18 Pax  318  13  10647  1.9.10.7  1.9.10.4  1 K’an  2 Sip  42 
14  11466  1.11.15.6  1.11.15.3  1 Ak’bal  11 Yaxk’in  131  15  12285  1.14.2.5  1.14.2.2  1 ’Ik’  0 Keh  220 
16  13104  1.16.7.4  1.16.7.1  1 ’Imix  9 Pax  309  17  13923  1.18.12.3  1.18.12.0  1 ’Ahaw  13 Wo  33 
18  14742  2.0.17.2  2.0.16.19  1 Kawak  2 Yaxk’in  122  19  15561  2.3.4.1  2.3.3.18  1 ’Etz’nab  11 Sak  211 
20  16380  2.5.9.0  2.5.8.17  1 Kaban  0 Pax  300  21  17199  2.7.13.19  2.7.13.16  1 K’ib  4 Wo  24 
22  18018  2.10.0.18  2.10.0.15  1 Men  13 Xul  113  23  18837  2.12.5.17  2.12.5.14  1 ’Ix  2 Sak  202 
24  19656  2.14.10.16  2.14.10.13  1 Ben  11 Muwan  291  25  20475  2.16.15.15  2.16.15.12  1 ’Eb  15 Pohp  15 
26  21294  2.19.2.14  2.19.2.11  1 Chuwen  4 Xul  104  27  22113  3.1.7.13  3.1.7.10  1 Ok  13 Yax  193 
28  22932  3.3.12.12  3.3.12.9  1 Muluk  2 Muwan  282  29  23751  3.5.17.11  3.5.17.8  1 Lamat  6 Pohp  6 
30  24570  3.8.4.10  3.8.4.7  1 Manik’  15 Sek  95  31  25389  3.10.9.9  3.10.9.6  1 Kimi  4 Yax  184 
32  26208  3.12.14.8  3.12.14.5  1 Chik’chan  13 K’ank’in  273  33  27027  3.15.1.7  3.15.1.4  1 K’an  2 Wayeb  362 
34  27846  3.17.6.6  3.17.6.3  1 Ak’bal  6 Sek  86  35  28665  3.19.11.5  3.19.11.2  1 ’Ik’  15 Ch’en  175 
36  29484  4.1.16.4  4.1.16.1  1 ’Imix  4 K’ank’in  264  37  30303  4.4.3.3  4.4.3.0  1 ’Ahaw  13 Kumk’u  353 
38  31122  4.6.8.2  4.6.7.19  1 Kawak  17 Sots  77  39  31941  4.8.13.1  4.8.12.18  1 ’Etz’nab  6 Ch’en  166 
40  32760  4.11.0.0  4.10.17.17  1 Kaban  15 Mak  255  41  33579  4.13.4.19  4.13.4.16  1 K’ib  4 Kumk’u  344 
42  34398  4.15.9.18  4.15.9.15  1 Men  8 Sots  68  43  35217  4.17.14.17  4.17.14.14  1 ’Ix  17 Mol  157 
44  36036  5.0.1.16  5.0.1.13  1 Ben  6 Mak  246  45  36855  5.2.6.15  5.2.6.12  1 ’Eb  15 K’ayab  335 
46  37674  5.4.11.14  5.4.11.11  1 Chuwen  19 Sip  59  47  38493  5.6.16.13  5.6.16.10  1 Ok  8 Mol  148 
48  39312  5.9.3.12  5.9.3.9  1 Muluk  17 Keh  237  49  40131  5.11.8.11  5.11.8.8  1 Lamat  6 K’ayab  326 
50  40950  5.13.13.10  5.13.13.7  1 Manik’  10 Sip  50  51  41769  5.16.0.9  5.16.0.6  1 Kimi  19 Yaxk’in  139 
52  42588  5.18.5.8  5.18.5.5  1 Chik’chan  8 Keh  228  53  43407  6.0.10.7  6.0.10.4  1 K’an  17 Pax  317 
54  44226  6.2.15.6  6.2.15.3  1 Ak’bal  1 Sip  41  55  45045  6.5.2.5  6.5.2.2  1 ’Ik’  10 Yaxk’in  130 
56  45864  6.7.7.4  6.7.7.1  1 ’Imix  19 Sak  219  57  46683  6.9.12.3  6.9.12.0  1 ’Ahaw  8 Pax  308 
58  47502  6.11.17.2  6.11.16.19  1 Kawak  12 Wo  32  59  48321  6.14.4.1  6.14.3.18  1 ’Etz’nab  1 Yaxk’in  121 
60  49140  6.16.9.0  6.16.8.17  1 Kaban  10 Sak  210  61  49959  6.18.13.19  6.18.13.16  1 K’ib  19 Muwan  299 
62  50778  7.1.0.18  7.1.0.15  1 Men  3 Wo  23  63  51597  7.3.5.17  7.3.5.14  1 ’Ix  12 Xul  112 
64  52416  7.5.10.16  7.5.10.13  1 Ben  1 Sak  201  65  53235  7.7.15.15  7.7.15.12  1 ’Eb  10 Muwan  290 
66  54054  7.10.2.14  7.10.2.11  1 Chuwen  14 Pohp  14  67  54873  7.12.7.13  7.12.7.10  1 Ok  3 Xul  103 
68  55692  7.14.12.12  7.14.12.9  1 Muluk  12 Yax  192  69  56511  7.16.17.11  7.16.17.8  1 Lamat  1 Muwan  281 
70  57330  7.19.4.10  7.19.4.7  1 Manik’  5 Pohp  5  71  58149  8.1.9.9  8.1.9.6  1 Kimi  14 Sek  94 
72  58968  8.3.14.8  8.3.14.5  1 Chik’chan  3 Yax  183  73  59787  8.6.1.7  8.6.1.4  1 K’an  12 K’ank’in  272 
74  60606  8.8.6.6  8.8.6.3  1 Ak’bal  1 Wayeb  361  75  61425  8.10.11.5  8.10.11.2  1 ’Ik’  5 Sek  85 
76  62244  8.12.16.4  8.12.16.1  1 ’Imix  14 Ch’en  174  77  63063  8.15.3.3  8.15.3.0  1 ’Ahaw  3 K’ank’in  263 
78  63882  8.17.8.2  8.17.7.19  1 Kawak  12 Kumk’u  352  79  64701  8.19.13.1  8.19.12.18  1 ’Etz’nab  16 Sots  76 
80  65520  9.2.0.0  9.1.17.17  1 Kaban  5 Ch’en  165  81  66339  9.4.4.19  9.4.4.16  1 K’ib  14 Mak  254 
82  67158  9.6.9.18  9.6.9.15  1 Men  3 Kumk’u  343  83  67977  9.8.14.17  9.8.14.14  1 ’Ix  7 Sots  67 
84  68796  9.11.1.16  9.11.1.13  1 Ben  16 Mol  156  85  69615  9.13.6.15  9.13.6.12  1 ’Eb  5 Mak  245 
86  70434  9.15.11.14  9.15.11.11  1 Chuwen  14 K’ayab  334  87  71253  9.17.16.13  9.17.16.10  1 Ok  18 Sip  58 
88  72072  10.0.3.12  10.0.3.9  1 Muluk  7 Mol  147  89  72891  10.2.8.11  10.2.8.8  1 Lamat  16 Keh  236 
90  73710  10.4.13.10  10.4.13.7  1 Manik’  5 K’ayab  325  91  74529  10.7.0.9  10.7.0.6  1 Kimi  9 Sip  49 
92  75348  10.9.5.8  10.9.5.5  1 Chik’chan  18 Yaxk’in  138  93  76167  10.11.10.7  10.11.10.4  1 K’an  7 Keh  227 
94  76986  10.13.15.6  10.13.15.3  1 Ak’bal  16 Pax  316  95  77805  10.16.2.5  10.16.2.2  1 ’Ik’  0 Sip  40 
96  78624  10.18.7.4  10.18.7.1  1 ’Imix  9 Yaxk’in  129  97  79443  11.0.12.3  11.0.12.0  1 ’Ahaw  18 Sak  218 
98  80262  11.2.17.2  11.2.16.19  1 Kawak  7 Pax  307  99  81081  11.5.4.1  11.5.3.18  1 ’Etz’nab  11 Wo  31 
100  81900  11.7.9.0  11.7.8.17  1 Kaban  0 Yaxk’in  120  101  82719  11.9.13.19  11.9.13.16  1 K’ib  9 Sak  209 
102  83538  11.12.0.18  11.12.0.15  1 Men  18 Muwan  298  103  84357  11.14.5.17  11.14.5.14  1 ’Ix  2 Wo  22 
104  85176  11.16.10.16  11.16.10.13  1 Ben  11 Xul  111  105  85995  11.18.15.15  11.18.15.12  1 ’Eb  0 Sak  200 
106  86814  12.1.2.14  12.1.2.11  1 Chuwen  9 Muwan  289  107  87633  12.3.7.13  12.3.7.10  1 Ok  13 Pohp  13 
108  88452  12.5.12.12  12.5.12.9  1 Muluk  2 Xul  102  109  89271  12.7.17.11  12.7.17.8  1 Lamat  11 Yax  191 
110  90090  12.10.4.10  12.10.4.7  1 Manik’  0 Muwan  280  111  90909  12.12.9.9  12.12.9.6  1 Kimi  4 Pohp  4 
112  91728  12.14.14.8  12.14.14.5  1 Chik’chan  13 Sek  93  113  92547  12.17.1.7  12.17.1.4  1 K’an  2 Yax  182 
114  93366  12.19.6.6  12.19.6.3  1 Ak’bal  11 K’ank’in  271  115  94185  13.1.11.5  13.1.11.2  1 ’Ik’  0 Wayeb  360 
116  95004  13.3.16.4  13.3.16.1  1 ’Imix  4 Sek  84  117  95823  13.6.3.3  13.6.3.0  1 ’Ahaw  13 Ch’en  173 
118  96642  13.8.8.2  13.8.7.19  1 Kawak  2 K’ank’in  262  119  97461  13.10.13.1  13.10.12.18  1 ’Etz’nab  11 Kumk’u  351 
120  98280  13.13.0.0  13.12.17.17  1 Kaban  15 Sots  75  121  99099  13.15.4.19  13.15.4.16  1 K’ib  4 Ch’en  164 
122  99918  13.17.9.18  13.17.9.15  1 Men  13 Mak  253  123  100737  13.19.14.17  13.19.14.14  1 ’Ix  2 Kumk’u  342 
124  101556  14.2.1.16  14.2.1.13  1 Ben  6 Sots  66  125  102375  14.4.6.15  14.4.6.12  1 ’Eb  15 Mol  155 
126  103194  14.6.11.14  14.6.11.11  1 Chuwen  4 Mak  244  127  104013  14.8.16.13  14.8.16.10  1 Ok  13 K’ayab  333 
128  104832  14.11.3.12  14.11.3.9  1 Muluk  17 Sip  57  129  105651  14.13.8.11  14.13.8.8  1 Lamat  6 Mol  146 
130  106470  14.15.13.10  14.15.13.7  1 Manik’  15 Keh  235  131  107289  14.18.0.9  14.18.0.6  1 Kimi  4 K’ayab  324 
132  108108  15.0.5.8  15.0.5.5  1 Chik’chan  8 Sip  48  133  108927  15.2.10.7  15.2.10.4  1 K’an  17 Yaxk’in  137 
134  109746  15.4.15.6  15.4.15.3  1 Ak’bal  6 Keh  226  135  110565  15.7.2.5  15.7.2.2  1 ’Ik’  15 Pax  315 
136  111384  15.9.7.4  15.9.7.1  1 ’Imix  19 Wo  39  137  112203  15.11.12.3  15.11.12.0  1 ’Ahaw  8 Yaxk’in  128 
138  113022  15.13.17.2  15.13.16.19  1 Kawak  17 Sak  217  139  113841  15.16.4.1  15.16.3.18  1 ’Etz’nab  6 Pax  306 
140  114660  15.18.9.0  15.18.8.17  1 Kaban  10 Wo  30  141  115479  16.0.13.19  16.0.13.16  1 K’ib  19 Xul  119 
142  116298  16.3.0.18  16.3.0.15  1 Men  8 Sak  208  143  117117  16.5.5.17  16.5.5.14  1 ’Ix  17 Muwan  297 
144  117936  16.7.10.16  16.7.10.13  1 Ben  1 Wo  21  145  118755  16.9.15.15  16.9.15.12  1 ’Eb  10 Xul  110 
146  119574  16.12.2.14  16.12.2.11  1 Chuwen  19 Yax  199  147  120393  16.14.7.13  16.14.7.10  1 Ok  8 Muwan  288 
148  121212  16.16.12.12  16.16.12.9  1 Muluk  12 Pohp  12  149  122031  16.18.17.11  16.18.17.8  1 Lamat  1 Xul  101 
150  122850  17.1.4.10  17.1.4.7  1 Manik’  10 Yax  190  151  123669  17.3.9.9  17.3.9.6  1 Kimi  19 K’ank’in  279 
152  124488  17.5.14.8  17.5.14.5  1 Chik’chan  3 Pohp  3  153  125307  17.8.1.7  17.8.1.4  1 K’an  12 Sek  92 
154  126126  17.10.6.6  17.10.6.3  1 Ak’bal  1 Yax  181  155  126945  17.12.11.5  17.12.11.2  1 ’Ik’  10 K’ank’in  270 
156  127764  17.14.16.4  17.14.16.1  1 ’Imix  19 Kumk’u  359  157  128583  17.17.3.3  17.17.3.0  1 ’Ahaw  3 Sek  83 
158  129402  17.19.8.2  17.19.7.19  1 Kawak  12 Ch’en  172  159  130221  18.1.13.1  18.1.12.18  1 ’Etz’nab  1 K’ank’in  261 
160  131040  18.4.0.0  18.3.17.17  1 Kaban  10 Kumk’u  350  161  131859  18.6.4.19  18.6.4.16  1 K’ib  14 Sots  74 
162  132678  18.8.9.18  18.8.9.15  1 Men  3 Ch’en  163  163  133497  18.10.14.17  18.10.14.14  1 ’Ix  12 Mak  252 
164  134316  18.13.1.16  18.13.1.13  1 Ben  1 Kumk’u  341  165  135135  18.15.6.15  18.15.6.12  1 ’Eb  5 Sots  65 
166  135954  18.17.11.14  18.17.11.11  1 Chuwen  14 Mol  154  167  136773  18.19.16.13  18.19.16.10  1 Ok  3 Mak  243 
168  137592  19.2.3.12  19.2.3.9  1 Muluk  12 K’ayab  332  169  138411  19.4.8.11  19.4.8.8  1 Lamat  16 Sip  56 
170  139230  19.6.13.10  19.6.13.7  1 Manik’  5 Mol  145  171  140049  19.9.0.9  19.9.0.6  1 Kimi  14 Keh  234 
172  140868  19.11.5.8  19.11.5.5  1 Chik’chan  3 K’ayab  323  173  141687  19.13.10.7  19.13.10.4  1 K’an  7 Sip  47 
174  142506  19.15.15.6  19.15.15.3  1 Ak’bal  16 Yaxk’in  136  175  143325  19.18.2.5  19.18.2.2  1 ’Ik’  5 Keh  225 
176  144144  1.0.0.7.4  1.0.0.7.1  1 ’Imix  14 Pax  314  177  144963  1.0.2.12.3  1.0.2.12.0  1 ’Ahaw  18 Wo  38 
178  145782  1.0.4.17.2  1.0.4.16.19  1 Kawak  7 Yaxk’in  127  179  146601  1.0.7.4.1  1.0.7.3.18  1 ’Etz’nab  16 Sak  216 
180  147420  1.0.9.9.0  1.0.9.8.17  1 Kaban  5 Pax  305  181  148239  1.0.11.13.19  1.0.11.13.16  1 K’ib  9 Wo  29 
182  149058  1.0.14.0.18  1.0.14.0.15  1 Men  18 Xul  118  183  149877  1.0.16.5.17  1.0.16.5.14  1 ’Ix  7 Sak  207 
184  150696  1.0.18.10.16  1.0.18.10.13  1 Ben  16 Muwan  296  185  151515  1.1.0.15.15  1.1.0.15.12  1 ’Eb  0 Wo  20 
186  152334  1.1.3.2.14  1.1.3.2.11  1 Chuwen  9 Xul  109  187  153153  1.1.5.7.13  1.1.5.7.10  1 Ok  18 Yax  198 
188  153972  1.1.7.12.12  1.1.7.12.9  1 Muluk  7 Muwan  287  189  154791  1.1.9.17.11  1.1.9.17.8  1 Lamat  11 Pohp  11 
190  155610  1.1.12.4.10  1.1.12.4.7  1 Manik’  0 Xul  100  191  156429  1.1.14.9.9  1.1.14.9.6  1 Kimi  9 Yax  189 
192  157248  1.1.16.14.8  1.1.16.14.5  1 Chik’chan  18 K’ank’in  278  193  158067  1.1.19.1.7  1.1.19.1.4  1 K’an  2 Pohp  2 
194  158886  1.2.1.6.6  1.2.1.6.3  1 Ak’bal  11 Sek  91  195  159705  1.2.3.11.5  1.2.3.11.2  1 ’Ik’  0 Yax  180 
196  160524  1.2.5.16.4  1.2.5.16.1  1 ’Imix  9 K’ank’in  269  197  161343  1.2.8.3.3  1.2.8.3.0  1 ’Ahaw  18 Kumk’u  358 
198  162162  1.2.10.8.2  1.2.10.7.19  1 Kawak  2 Sek  82  199  162981  1.2.12.13.1  1.2.12.12.18  1 ’Etz’nab  11 Ch’en  171 
200  163800  1.2.15.0.0  1.2.14.17.17  1 Kaban  0 K’ank’in  260  201  164619  1.2.17.4.19  1.2.17.4.16  1 K’ib  9 Kumk’u  349 
202  165438  1.2.19.9.18  1.2.19.9.15  1 Men  13 Sots  73  203  166257  1.3.1.14.17  1.3.1.14.14  1 ’Ix  2 Ch’en  162 
204  167076  1.3.4.1.16  1.3.4.1.13  1 Ben  11 Mak  251  205  167895  1.3.6.6.15  1.3.6.6.12  1 ’Eb  0 Kumk’u  340 
206  168714  1.3.8.11.14  1.3.8.11.11  1 Chuwen  4 Sots  64  207  169533  1.3.10.16.13  1.3.10.16.10  1 Ok  13 Mol  153 
208  170352  1.3.13.3.12  1.3.13.3.9  1 Muluk  2 Mak  242  209  171171  1.3.15.8.11  1.3.15.8.8  1 Lamat  11 K’ayab  331 
210  171990  1.3.17.13.10  1.3.17.13.7  1 Manik’  15 Sip  55  211  172809  1.4.0.0.9  1.4.0.0.6  1 Kimi  4 Mol  144 
212  173628  1.4.2.5.8  1.4.2.5.5  1 Chik’chan  13 Keh  233  213  174447  1.4.4.10.7  1.4.4.10.4  1 K’an  2 K’ayab  322 
214  175266  1.4.6.15.6  1.4.6.15.3  1 Ak’bal  6 Sip  46  215  176085  1.4.9.2.5  1.4.9.2.2  1 ’Ik’  15 Yaxk’in  135 
216  176904  1.4.11.7.4  1.4.11.7.1  1 ’Imix  4 Keh  224  217  177723  1.4.13.12.3  1.4.13.12.0  1 ’Ahaw  13 Pax  313 
218  178542  1.4.15.17.2  1.4.15.16.19  1 Kawak  17 Wo  37  219  179361  1.4.18.4.1  1.4.18.3.18  1 ’Etz’nab  6 Yaxk’in  126 
220  180180  1.5.0.9.0  1.5.0.8.17  1 Kaban  15 Sak  215  221  180999  1.5.2.13.19  1.5.2.13.16  1 K’ib  4 Pax  304 
222  181818  1.5.5.0.18  1.5.5.0.15  1 Men  8 Wo  28  223  182637  1.5.7.5.17  1.5.7.5.14  1 ’Ix  17 Xul  117 
224  183456  1.5.9.10.16  1.5.9.10.13  1 Ben  6 Sak  206  225  184275  1.5.11.15.15  1.5.11.15.12  1 ’Eb  15 Muwan  295 
226  185094  1.5.14.2.14  1.5.14.2.11  1 Chuwen  19 Pohp  19  227  185913  1.5.16.7.13  1.5.16.7.10  1 Ok  8 Xul  108 
228  186732  1.5.18.12.12  1.5.18.12.9  1 Muluk  17 Yax  197  229  187551  1.6.0.17.11  1.6.0.17.8  1 Lamat  6 Muwan  286 
230  188370  1.6.3.4.10  1.6.3.4.7  1 Manik’  10 Pohp  10  231  189189  1.6.5.9.9  1.6.5.9.6  1 Kimi  19 Sek  99 
232  190008  1.6.7.14.8  1.6.7.14.5  1 Chik’chan  8 Yax  188  233  190827  1.6.10.1.7  1.6.10.1.4  1 K’an  17 K’ank’in  277 
234  191646  1.6.12.6.6  1.6.12.6.3  1 Ak’bal  1 Pohp  1  235  192465  1.6.14.11.5  1.6.14.11.2  1 ’Ik’  10 Sek  90 
236  193284  1.6.16.16.4  1.6.16.16.1  1 ’Imix  19 Ch’en  179  237  194103  1.6.19.3.3  1.6.19.3.0  1 ’Ahaw  8 K’ank’in  268 
238  194922  1.7.1.8.2  1.7.1.7.19  1 Kawak  17 Kumk’u  357  239  195741  1.7.3.13.1  1.7.3.12.18  1 ’Etz’nab  1 Sek  81 
240  196560  1.7.6.0.0  1.7.5.17.17  1 Kaban  10 Ch’en  170  241  197379  1.7.8.4.19  1.7.8.4.16  1 K’ib  19 Mak  259 
242  198198  1.7.10.9.18  1.7.10.9.15  1 Men  8 Kumk’u  348  243  199017  1.7.12.14.17  1.7.12.14.14  1 ’Ix  12 Sots  72 
244  199836  1.7.15.1.16  1.7.15.1.13  1 Ben  1 Ch’en  161  245  200655  1.7.17.6.15  1.7.17.6.12  1 ’Eb  10 Mak  250 
246  201474  1.7.19.11.14  1.7.19.11.11  1 Chuwen  19 K’ayab  339  247  202293  1.8.1.16.13  1.8.1.16.10  1 Ok  3 Sots  63 
248  203112  1.8.4.3.12  1.8.4.3.9  1 Muluk  12 Mol  152  249  203931  1.8.6.8.11  1.8.6.8.8  1 Lamat  1 Mak  241 
250  204750  1.8.8.13.10  1.8.8.13.7  1 Manik’  10 K’ayab  330  251  205569  1.8.11.0.9  1.8.11.0.6  1 Kimi  14 Sip  54 
252  206388  1.8.13.5.8  1.8.13.5.5  1 Chik’chan  3 Mol  143  253  207207  1.8.15.10.7  1.8.15.10.4  1 K’an  12 Keh  232 
254  208026  1.8.17.15.6  1.8.17.15.3  1 Ak’bal  1 K’ayab  321  255  208845  1.9.0.2.5  1.9.0.2.2  1 ’Ik’  5 Sip  45 
256  209664  1.9.2.7.4  1.9.2.7.1  1 ’Imix  14 Yaxk’in  134  257  210483  1.9.4.12.3  1.9.4.12.0  1 ’Ahaw  3 Keh  223 
258  211302  1.9.6.17.2  1.9.6.16.19  1 Kawak  12 Pax  312  259  212121  1.9.9.4.1  1.9.9.3.18  1 ’Etz’nab  16 Wo  36 
260  212940  1.9.11.9.0  1.9.11.8.17  1 Kaban  5 Yaxk’in  125  261  213759  1.9.13.13.19  1.9.13.13.16  1 K’ib  14 Sak  214 
262  214578  1.9.16.0.18  1.9.16.0.15  1 Men  3 Pax  303  263  215397  1.9.18.5.17  1.9.18.5.14  1 ’Ix  7 Wo  27 
264  216216  1.10.0.10.16  1.10.0.10.13  1 Ben  16 Xul  116  265  217035  1.10.2.15.15  1.10.2.15.12  1 ’Eb  5 Sak  205 
266  217854  1.10.5.2.14  1.10.5.2.11  1 Chuwen  14 Muwan  294  267  218673  1.10.7.7.13  1.10.7.7.10  1 Ok  18 Pohp  18 
268  219492  1.10.9.12.12  1.10.9.12.9  1 Muluk  7 Xul  107  269  220311  1.10.11.17.11  1.10.11.17.8  1 Lamat  16 Yax  196 
270  221130  1.10.14.4.10  1.10.14.4.7  1 Manik’  5 Muwan  285  271  221949  1.10.16.9.9  1.10.16.9.6  1 Kimi  9 Pohp  9 
272  222768  1.10.18.14.8  1.10.18.14.5  1 Chik’chan  18 Sek  98  273  223587  1.11.1.1.7  1.11.1.1.4  1 K’an  7 Yax  187 
274  224406  1.11.3.6.6  1.11.3.6.3  1 Ak’bal  16 K’ank’in  276  275  225225  1.11.5.11.5  1.11.5.11.2  1 ’Ik’  0 Pohp  0 
276  226044  1.11.7.16.4  1.11.7.16.1  1 ’Imix  9 Sek  89  277  226863  1.11.10.3.3  1.11.10.3.0  1 ’Ahaw  18 Ch’en  178 
278  227682  1.11.12.8.2  1.11.12.7.19  1 Kawak  7 K’ank’in  267  279  228501  1.11.14.13.1  1.11.14.12.18  1 ’Etz’nab  16 Kumk’u  356 
280  229320  1.11.17.0.0  1.11.16.17.17  1 Kaban  0 Sek  80  281  230139  1.11.19.4.19  1.11.19.4.16  1 K’ib  9 Ch’en  169 
282  230958  1.12.1.9.18  1.12.1.9.15  1 Men  18 Mak  258  283  231777  1.12.3.14.17  1.12.3.14.14  1 ’Ix  7 Kumk’u  347 
284  232596  1.12.6.1.16  1.12.6.1.13  1 Ben  11 Sots  71  285  233415  1.12.8.6.15  1.12.8.6.12  1 ’Eb  0 Ch’en  160 
286  234234  1.12.10.11.14  1.12.10.11.11  1 Chuwen  9 Mak  249  287  235053  1.12.12.16.13  1.12.12.16.10  1 Ok  18 K’ayab  338 
288  235872  1.12.15.3.12  1.12.15.3.9  1 Muluk  2 Sots  62  289  236691  1.12.17.8.11  1.12.17.8.8  1 Lamat  11 Mol  151 
290  237510  1.12.19.13.10  1.12.19.13.7  1 Manik’  0 Mak  240  291  238329  1.13.2.0.9  1.13.2.0.6  1 Kimi  9 K’ayab  329 
292  239148  1.13.4.5.8  1.13.4.5.5  1 Chik’chan  13 Sip  53  293  239967  1.13.6.10.7  1.13.6.10.4  1 K’an  2 Mol  142 
294  240786  1.13.8.15.6  1.13.8.15.3  1 Ak’bal  11 Keh  231  295  241605  1.13.11.2.5  1.13.11.2.2  1 ’Ik’  0 K’ayab  320 
296  242424  1.13.13.7.4  1.13.13.7.1  1 ’Imix  4 Sip  44  297  243243  1.13.15.12.3  1.13.15.12.0  1 ’Ahaw  13 Yaxk’in  133 
298  244062  1.13.17.17.2  1.13.17.16.19  1 Kawak  2 Keh  222  299  244881  1.14.0.4.1  1.14.0.3.18  1 ’Etz’nab  11 Pax  311 
300  245700  1.14.2.9.0  1.14.2.8.17  1 Kaban  15 Wo  35  301  246519  1.14.4.13.19  1.14.4.13.16  1 K’ib  4 Yaxk’in  124 
302  247338  1.14.7.0.18  1.14.7.0.15  1 Men  13 Sak  213  303  248157  1.14.9.5.17  1.14.9.5.14  1 ’Ix  2 Pax  302 
304  248976  1.14.11.10.16  1.14.11.10.13  1 Ben  6 Wo  26  305  249795  1.14.13.15.15  1.14.13.15.12  1 ’Eb  15 Xul  115 
306  250614  1.14.16.2.14  1.14.16.2.11  1 Chuwen  4 Sak  204  307  251433  1.14.18.7.13  1.14.18.7.10  1 Ok  13 Muwan  293 
308  252252  1.15.0.12.12  1.15.0.12.9  1 Muluk  17 Pohp  17  309  253071  1.15.2.17.11  1.15.2.17.8  1 Lamat  6 Xul  106 
310  253890  1.15.5.4.10  1.15.5.4.7  1 Manik’  15 Yax  195  311  254709  1.15.7.9.9  1.15.7.9.6  1 Kimi  4 Muwan  284 
312  255528  1.15.9.14.8  1.15.9.14.5  1 Chik’chan  8 Pohp  8  313  256347  1.15.12.1.7  1.15.12.1.4  1 K’an  17 Sek  97 
314  257166  1.15.14.6.6  1.15.14.6.3  1 Ak’bal  6 Yax  186  315  257985  1.15.16.11.5  1.15.16.11.2  1 ’Ik’  15 K’ank’in  275 
316  258804  1.15.18.16.4  1.15.18.16.1  1 ’Imix  4 Wayeb  364  317  259623  1.16.1.3.3  1.16.1.3.0  1 ’Ahaw  8 Sek  88 
318  260442  1.16.3.8.2  1.16.3.7.19  1 Kawak  17 Ch’en  177  319  261261  1.16.5.13.1  1.16.5.12.18  1 ’Etz’nab  6 K’ank’in  266 
320  262080  1.16.8.0.0  1.16.7.17.17  1 Kaban  15 Kumk’u  355  321  262899  1.16.10.4.19  1.16.10.4.16  1 K’ib  19 Sots  79 
322  263718  1.16.12.9.18  1.16.12.9.15  1 Men  8 Ch’en  168  323  264537  1.16.14.14.17  1.16.14.14.14  1 ’Ix  17 Mak  257 
324  265356  1.16.17.1.16  1.16.17.1.13  1 Ben  6 Kumk’u  346  325  266175  1.16.19.6.15  1.16.19.6.12  1 ’Eb  10 Sots  70 
326  266994  1.17.1.11.14  1.17.1.11.11  1 Chuwen  19 Mol  159  327  267813  1.17.3.16.13  1.17.3.16.10  1 Ok  8 Mak  248 
328  268632  1.17.6.3.12  1.17.6.3.9  1 Muluk  17 K’ayab  337  329  269451  1.17.8.8.11  1.17.8.8.8  1 Lamat  1 Sots  61 
330  270270  1.17.10.13.10  1.17.10.13.7  1 Manik’  10 Mol  150  331  271089  1.17.13.0.9  1.17.13.0.6  1 Kimi  19 Keh  239 
332  271908  1.17.15.5.8  1.17.15.5.5  1 Chik’chan  8 K’ayab  328  333  272727  1.17.17.10.7  1.17.17.10.4  1 K’an  12 Sip  52 
334  273546  1.17.19.15.6  1.17.19.15.3  1 Ak’bal  1 Mol  141  335  274365  1.18.2.2.5  1.18.2.2.2  1 ’Ik’  10 Keh  230 
336  275184  1.18.4.7.4  1.18.4.7.1  1 ’Imix  19 Pax  319  337  276003  1.18.6.12.3  1.18.6.12.0  1 ’Ahaw  3 Sip  43 
338  276822  1.18.8.17.2  1.18.8.16.19  1 Kawak  12 Yaxk’in  132  339  277641  1.18.11.4.1  1.18.11.3.18  1 ’Etz’nab  1 Keh  221 
340  278460  1.18.13.9.0  1.18.13.8.17  1 Kaban  10 Pax  310  341  279279  1.18.15.13.19  1.18.15.13.16  1 K’ib  14 Wo  34 
342  280098  1.18.18.0.18  1.18.18.0.15  1 Men  3 Yaxk’in  123  343  280917  1.19.0.5.17  1.19.0.5.14  1 ’Ix  12 Sak  212 
344  281736  1.19.2.10.16  1.19.2.10.13  1 Ben  1 Pax  301  345  282555  1.19.4.15.15  1.19.4.15.12  1 ’Eb  5 Wo  25 
346  283374  1.19.7.2.14  1.19.7.2.11  1 Chuwen  14 Xul  114  347  284193  1.19.9.7.13  1.19.9.7.10  1 Ok  3 Sak  203 
348  285012  1.19.11.12.12  1.19.11.12.9  1 Muluk  12 Muwan  292  349  285831  1.19.13.17.11  1.19.13.17.8  1 Lamat  16 Pohp  16 
350  286650  1.19.16.4.10  1.19.16.4.7  1 Manik’  5 Xul  105  351  287469  1.19.18.9.9  1.19.18.9.6  1 Kimi  14 Yax  194 
352  288288  2.0.0.14.8  2.0.0.14.5  1 Chik’chan  3 Muwan  283  353  289107  2.0.3.1.7  2.0.3.1.4  1 K’an  7 Pohp  7 
354  289926  2.0.5.6.6  2.0.5.6.3  1 Ak’bal  16 Sek  96  355  290745  2.0.7.11.5  2.0.7.11.2  1 ’Ik’  5 Yax  185 
356  291564  2.0.9.16.4  2.0.9.16.1  1 ’Imix  14 K’ank’in  274  357  292383  2.0.12.3.3  2.0.12.3.0  1 ’Ahaw  3 Wayeb  363 
358  293202  2.0.14.8.2  2.0.14.7.19  1 Kawak  7 Sek  87  359  294021  2.0.16.13.1  2.0.16.12.18  1 ’Etz’nab  16 Ch’en  176 
360  294840  2.0.19.0.0  2.0.18.17.17  1 Kaban  5 K’ank’in  265  361  295659  2.1.1.4.19  2.1.1.4.16  1 K’ib  14 Kumk’u  354 
362  296478  2.1.3.9.18  2.1.3.9.15  1 Men  18 Sots  78  363  297297  2.1.5.14.17  2.1.5.14.14  1 ’Ix  7 Ch’en  167 
364  298116  2.1.8.1.16  2.1.8.1.13  1 Ben  16 Mak  256  365  298935  2.1.10.6.15  2.1.10.6.12  1 ’Eb  5 Kumk’u  345 
819Day Cycle 
Days Elapsed Eng. Mayan 
Long Count  Tzolk’in  Haab  Haab Position (Δh) 
819Day Cycle 
Days Elapsed Eng. Mayan 
Long Count  Tzolk’in  Haab  Haab Position (Δh) 
This is Knuth’s description of the Pulverizer:
This extension of Euclid’s algorithm can be described conveniently in vector notation: Algorithm X (Extended Euclid’s algorithm). Given nonnegative integers u and v, this algorithm determines a vector (u_{1}, u_{2}, u_{3}) such that uu_{1} + uu_{2} = u_{3} = gcd(u, v). The computation makes use of auxiliary vectors (v_{1}, v_{2}, v_{3}), (t_{1}, t_{2}, t_{3}); all vectors are manipulated in such a way that the relations ut_{1} + vt_{2} = t_{3};
uu_{1} + vu_{2} = u_{3};
uv_{1} + vv_{2} = v_{3};
hold throughout the calculation. X1. [Initialize.] Set (u_{1}, u_{2}, u_{3})
← (1, 0, u), (v_{1}, v_{2}, v_{3})
← (0, 1, v).
(t_{1}, t_{2}, t_{3}) ← (u_{1},
u_{2}, u_{3})  (v_{1}, v_{2}, v_{3})q,
(u_{1}, u_{2}, u_{3}) ← (v_{1}, v_{2}, v_{3}), (v_{1}, v_{2}, v_{3}) ← (t_{1}, t_{2}, t_{3}). Return to step X2. █ For example, let u = 40902, v = 24140. At step X2 we have
The solution is therefore 337 · 40902571 · 24140 = 34 = gcd(40902, 24140). 
This is the Python implementation of the Pulverizer:
def exgcd(u, v, pr = 0): u1, u2, u3 = 1, 0, u # X1 v1, v2, v3 = 0, 1, v # X1 q = 0 # X1 while v3 > 0: # X1 q = u3/v3 # X2 # Modification of Knuth’s algorithm from Tim Peters on the Python list; # this gets rid of the temporary variables and speeds it up. u1, u2, u3, v1, v2, v3 = v1, v2, v3, u1  v1 * q, u2  v2 * q, u3  v3 * q return u3, u1, u2 # X3: gcd, magic number 1, magic number 2 
For the example above, the greatest common divisor is
34, and u_{1} is 337, or c_{1}, while u_{2}
is 571, or c_{2}. In this case, we might expect c_{12}
to be 192427 (the product of 337 · 571), but, again according to Knuth,
“... we may take c_{ij} = a.” (Knuth, v2, 3.4.2)
In other words, just use c_{1} instead of carrying out the
multiplication that would give us c_{12} (what Knuth is
calling c_{ij}).
Since it may prove desirable to determine the 819day count position (Δe) from the three constituent coordinates Y (Y glyphs), G (G glyphs) and T (trecena), without recourse to the Long Count coeffecients, I’ll include here the methods for determining the value.
Garner’s method (Knuth, 1998), expanded to include three coordinates that are relatively prime instead of two as we have been using it, will do the job quite nicely.
v_{1} = u_{1} % m_{1}
v_{2} = (u_{2}  v_{1}) · c_{12} v_{2} = v_{2} % m_{2} v_{3} = (((u_{3}  v_{1}) · c_{13})  v_{2}) · c_{23} v_{3} = v_{3} % m_{3} u = v_{1} + (v_{2} · m_{1}) + (v_{3} · m_{2} · m_{1}) 
Where m_{1} = 7, m_{2} = 9, m_{3} = 13, and Δe = u. 
Finding our constants, or “magic numbers,” is very simple. We need to find the values c_{12}, c_{13} and c_{23}, and we can do this by feeding the combinations required to the Pulverizer (Python function exgcd()); these combinations are:
To determine:  Use:  Result (magic number): 

c_{12}  exgcd(7, 9)  4 
c_{13}  exgcd(7, 13)  2 
c_{23}  exgcd(9, 13)  3 
At this point, it might seem that we have enough information to recover 819day positions from Y, G and T, but this is not the case; the hardest part is yet to come. As given so far, the algorithm demands input values in one set of ranges, but the values that are used on monumental inscriptions do not match the required set. For example, while the algorithm wants G in the range 08, values on the inscriptions range from G6G5. Therefore, we need to remap the input value set onto another set, and we do that by following these rules and their formulae:
Variable  Actual Input Values
and Order 
Mathematical Equivalents  Expected Input Values
and Order 
Formula 

Y  7, 1, 2, 3, 4, 5, 6  0, 1, 2, 3, 4, 5, 6  0, 1, 2, 3, 4, 5, 6  u1 = Y if u1 == 7: u1 = 0 
G  6, 7, 8, 9, 1, 2, 3, 4, 5  6, 7, 8, 0, 1, 2, 3, 4, 5  0, 1, 2, 3, 4, 5, 6, 7, 8  u2 = (Y  6) % 9 
T  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12  u3 = (T  1) % 13 
What these rules mean is that our minimum input value set (7, 6, 1) [Y7, G6, T1] is transformed into the mathematically more useful set (0, 0, 0), and a similar transformation of the maximum set (6, 5, 13) [Y6, G5, T13] results in (6, 8, 12).
Incorporating Garner’s algorithm modified for 3 coordinates, the special constants found by the use of exgcd() and the formulae for the transformation of input values into a single Python function is straightforward, and results in:
def pe(Y, G, T): m1 = 7 # Radix for Y m2 = 9 # Radix for G m3 = 13 # Radix for T c12 = 4 # Magic number for 7 and 9 c13 = 2 # Magic number for 7 and 13 c23 = 3 # Magic number for 9 and 13 u1 = Y # Adjust input range for Y glyphs if u1 == m1: u1 = 0 u2 = (G  6) % m2 # Adjust input range for G glyphs u3 = (T  1) % m3 # Adjust input range for trecena v1 = u1 % m1 v2 = (u2  v1) * c12 v2 = v2 % m2 v3 = (((u3  v1) * c13)  v2) * c23 v3 = v3 % m3 pe = v1 + (v2 * m1) + (v3 * m2 * m1) return pe # The resultant position in the 819day count 
The converse function, to return Y, G and T coordinates from any given position in the 819day count (Δe) is almost trivial to implement:
def dpe(p): # p = 0818 Y = p % 7 if Y == 0: Y = 7 G = p % 9 G = (G + 6) % 9 if G == 0: G = 9 T = p % 13 T = (T + 1) % 13 if T == 0: T = 13 return(Y, G, T) 
The Python programming language is a very sophisticated but easy to use and learn language that has widespread application in many fields, not just in computer science. The first step in using Python to aid research in the Mayan calendar is to obtain and install it on your computer; since it is freely available for virtually all kinds of computers and operating systems, this is ordinarily not difficult. For users of Win95/98/NT, probably the majority of computerknowledgable Mayanists, this is an extremely simple step. As of this writing, the latest version available to the general public was version 2.4.2, and it can be downloaded from the Python web site. Follow the link and obey the instructions, which will install all you need (and more) to run everything described in this paper.
Once you’ve installed Python and verified that it is working, you should download the Mayan mathematics package I’ve written: mayalib.zip, which contains mayalib.py and hello.py, a tiny test program to make sure that both Python and mayalib have been installed correctly. You can use WinZip to unpack the zip file, or, on Unix, gzip. Either way, once you’ve unzipped mayalib.zip, find out where your Python distribution has been installed. Unless you overrode the destination during the install process, this will be in “c:\Program Files\Python”. Assuming that this directory is correct, put a copy of mayalib.py (note: the name may change; please see the README.TXT file that comes with the distribution to see the latest installation instructions) into “c:\Program Files\Python\lib”. Ensure that “c:\Program Files\Python” is in your path, cd to the directory where you have the copy of hello.py and type, in a DOS box: python hello.py. The hello.py program should tell you the date, in Mayan, if everything has been installed correctly.
Once installed, you can write Python programs for the Mayan calendar very easily. On Windows, use your favorite text editor (Notepad will do in a pinch), and type in program lines. At the Python website, there is a good tutorial available, written by Guido van Rossum, the creator of the language. Although it is aimed primarily at users who know some other programming language, it is nonetheless clear and concise. O’Reilly publishes Learning Python by Mark Lutz and David Ascher, which fills the niche for an introduction to Python for those with less programming experience. If you can find a copy, my own book Teach Yourself Python in 24 Hours, is adequate.
Programs that use the mayalib package should include the line from mayalib import * at or near the top of the file. As an example, here is a Python program that lists the first 20 819day stations, beginning with the usual starting day on 3, 1 Kaban 5 Kumk’u; run it by typing python 20.py in a DOS box:
from mayalib import * b = mayanum() # Create a Mayan date for day 0 b.calculate() # Calculate trecena, veintena, Calendar Round, etc. b = b  3 # Start at three days before 0 # Another way to get three days before 0 would be: # b = mayanum ( [ 3 ] ) # b.calculate ( ) b.calculate() # You have to recalculate subsidiary information after operations, # because , +, /, *, etc. only work on LC positions. print "Starting day:", b, b.gregorian() for i in range(21): print "%s: 819day position %d (%d,%d,%d), %s" % ( b, b.st819, b.Y, b.glord, b.trecena, colordirection ( b ) ) b = b + 819 # You could also do this as b = b + "2.4.19" b.calculate() print "Ending day:", b.gregorian() # # Set the correlation (the "'Ahaw Equation") to something else; # default is 584285. SetCorrelation ( 584283 ) # print "Ending day:", b.gregorian() 
Included in mayalib.zip is the above program, 20.py, the test program hello.py and full documentation in HTML format; you will need a web browser in order to use it (instructions can be found in the README.TXT file). The mayalib documentation assumes you know more about the Mayan calendar than programming, however, and comes with a full set of examples.



Main web site: http://www.pauahtun.org