Graham's number

Graham's number is a famous large number, defined using arrow notation:

\begin{eqnarray*} g_0 &=& 4 \\ g_1 &=& 3 \uparrow\uparrow\uparrow\uparrow 3 \\ g_2 &=& 3 \underbrace{\uparrow\uparrow\cdots\uparrow\uparrow}_{g_1 \text{ arrows}} 3 \\ g_{k} &=& 3 \underbrace{\uparrow\uparrow\uparrow\cdots\uparrow\uparrow\uparrow}_{g_k - 1 \text{ arrows}} 3 \\ g_{64} &=& \text{Graham's number} \end{eqnarray*}

Graham's number is celebrated as the largest number ever used in a mathematical proof, although larger numbers have since claimed this title (such as TREE(3) and SCG(13)). The smallest Bowersism exceeding Graham's number is corporal.

Basis
Graham's number arose out of the following unsolved problem in Ramsey Theory:

"Let N* be the smallest dimension n of a hypercube such that if the lines joining all pairs of corners are two-colored for any n ≥ N*, a complete graph K4 of one color with coplanar vertices will be forced. Find N*."

The upper bound of the problem was originally \(F^{7}(12)\), where \(F(n) = 2 \uparrow^{n} 3\). Sbiis Saibian calls this number "Little Graham".

Comparison
Since g0 is 4 and not 3, Graham's number cannot be expressed efficiently with most major googological functions. However, it is reasonably close to \(3 → 3 → 64 → 2\) in Conway's Chained Arrow Notation and \(\lbrace 3,65,1,2\rbrace\) in BEAF. In Jonathan Bowers' G functions, it is exactly equal to G644 or GGG...GGG4 (64 G's) in base 3.

Tim Chow proved that Graham's number is much larger than the Moser. The proof hinges on the fact that, using Steinhaus-Moser Notation, n in a (k + 2)-gon is less than \(n\underbrace{\uparrow\uparrow\ldots\uparrow\uparrow}_{2k-1}n\). He sent the proof to Susan Stepney on July 7, 1998. Coincidentally, Stepney was sent a similar proof by Todd Cesere several days later.

Calculating last digits
The final digits of Graham's number can be computed by taking advantage of the convergence of last digits, because Graham's number is a power tower of threes. Here is a simple algorithm to obtain the last \(x\) digits \(N(x)\) of Graham's number:


 * \(N(0) = 3\)
 * \(N(x) = 3^{N(x-1)} \text{ mod } 10^x\)

For example:
 * \(N(1) = 3^{N(0)} \equiv 3^3 \equiv 27 \equiv 7 \pmod 10\), so the last digit is 7.
 * \(N(2) = 3^{N(1)}\text{ mod }100 = 3^7\text{ mod }100 = 2187\text{ mod }100 = 87\), so the last two digits are 87.
 * \(N(3) = 3^{N(2)}\text{ mod }1000 = 3^{87}\text{ mod }1000 = 323257909929174534292273980721360271853387\text{ mod }1000 = 387\), so the last three digits are 387.

This naive method is not very efficient, since number of digits in the leftmost expression grows exponentially. We can use right-to left binary method instead:


 * Convert the exponent into binary form. E.g. \(87_{10} = 1010111_2\)
 * If last digit of exponent is 1, then multiply base to result and square base.
 * Otherwise, just square base.

Using this, it can be shown that last 20 digits of Graham's number are: \(...04575627262464195387\).