User blog comment:WaxPlanck/Last Digits of Graham's Number/@comment-30118230-20180131202203/@comment-1605058-20180131204251

The main idea here is that if we look at larger and larger power towers of threes, the last digits quickly stabilize - \(3^3,3^{3^3},3^{3^{3^3}},\dots\) have the same last digit, \(3^{3^3},3^{3^{3^3}},\dots\) have the same last two digits, \(3^{3^{3^3}},\dots\) have the same last three digits etc. Using this observation one can show that if we start with \(x_0=3\) and \(x_{n+1}=3^{x_n}\mod{10^N}\), then \(x_N\) gives us exactly the last \(N\) decimal digits of Graham's number.