Graham's number

Graham's number is a proven upper bound to the solution 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".

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.



Definition
Define the series g0 = 4, g1 = 3 ↑↑↑↑ 3 (using Arrow Notation), and \(g_n = 3\underbrace{\uparrow\uparrow\ldots\uparrow\uparrow}_{g_{n-1}}3\). Graham's number is g64.

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 \mod 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\).