# Calculating the rightmost digits of Graham's number

Through some miscellaneous reading I have stumbled upon Graham's number and more precisely, a method of calculating the $d$ rightmost digits of the number. The exact method of calculation seems straightforward through modular exponentiation. However, there is the claim that all power towers of height at least $d + 2$ will have their $d$ rightmost digits constant and independent of the topmost term of the tower. (At the risk of being too verbose, I redirect you to the Wikipedia article on Graham's number, bottom section.) I was wondering if anyone can provide a proof for the given statement.

-
This should follow from an iterated application of Carmichael's theorem: en.wikipedia.org/wiki/Carmichael_function – Qiaochu Yuan Aug 2 '11 at 23:11

 The proof in the reference doesn't seem to cover the case where the topmost term is arbitrary. That is, the proof seems to break down if $f(0) \neq p$ – EuYu Aug 3 '11 at 1:43