# Find the last two digits of 9^(9^9) [duplicate]

I want to find the last two digits of $9^{9^9}$, that is $9$ raised to the power $9^9$. I tried using Euler's theorem but I can't make anything of it.

As always, I ask only for a minor hint, not a solution.

-

## marked as duplicate by Brad, M Turgeon, Tomás, Ivo Terek, Carl MummertJul 30 '14 at 15:45

you tried math.stackexchange.com/questions/116548/…?? does it help somehow? – Praphulla Koushik Jan 30 '14 at 11:34
– lab bhattacharjee Jan 30 '14 at 18:10

Last $2$ digit essentially implies $\pmod{10^2}$

Method $1:$ $$9^{(9^9)}=(10-1)^{(9^9)}=\left[(-1)(1-10)\right]^{(9^9)}=-(1-10)^{(9^9)}\text{ as }9^9\text{ is odd}$$

Now uisng Binomial Theorem , $\displaystyle(1-10)^{(9^9)}=1-\binom{9^9}110^1\pmod{100}\equiv1-10\cdot9^9$

Again, $\displaystyle9^9=(10-1)^9\equiv-1\pmod{10}$

$\displaystyle\implies10\cdot9^9\equiv10(-1)\pmod{100}\equiv-10$

So,$$9^{(9^9)}\equiv-[1-(-10)]\equiv-11\pmod{100}\equiv89$$

as $9^{(9^9)}>0$ as any positive integer $n\pmod{100}$ lies $\in[0,100-1]$

Method $2:$ Alternatively, using Carmichael's theorem (which is generally more useful than Euler's totient theorem when the modulus is composite (why?))

We have $\displaystyle\lambda(100)=20\implies9^{(9^9)}\equiv9^{(9^9\pmod{20})}\pmod{100}$

Now, $\displaystyle9^2=81\equiv1\pmod{20}\implies 9^9\equiv(9^2)^4\cdot9\equiv9\pmod{20}$

So, $\displaystyle\lambda(100)=20\implies9^{(9^9)}\equiv9^9\pmod{100}$

Method $\displaystyle2A:$ Now, $\displaystyle9^9=(10-1)^9\equiv\binom9110^1-1\pmod{100}\equiv90-1$

Method $\displaystyle2B:$

$\displaystyle9^9=(3^2)^9=3^{18}\equiv3^{-2}\pmod{100}$ as $\displaystyle\lambda(100)=20\implies3^{20}\equiv1\pmod{100}$

Now, $\displaystyle3^{-2}\equiv\frac19\pmod{100}\equiv\frac{-99}9$ as $99\equiv-1\pmod{100}\iff-99\equiv1$

$\displaystyle\implies3^{-2}\equiv-11\pmod{100}\equiv100-11$ as $9^{(9^9)}>0$ as any positive integer $n\pmod{100}$ lies $\in[0,100-1]$

-
I asked for a hint, but this is good too ( awesome to be honest, just not fun since I like to try to do it myself :D I tried with BT and (10-1) but got stuck.. Thanks ;) – Transcendental Jan 31 '14 at 18:29
@Irrational, sorry I could not determine where to stop before the end – lab bhattacharjee Feb 1 '14 at 8:20

The last two digits of $9^n$ form a repetition cycle of length $10$, starting at $n=0$. So your question is equivalent to finding the remainder of $n\mod10$, where $n=9^9$, which shouldn't be too hard, given that $9=10-1$, so $9^9\mod10=(-1)^9\mod10=-1$, so we are looking for the last element of the afore-mentioned cycle (the first being $1$, for $n=0$), which is $89$.

-

Hint : Reduce the exponent $9^9$ modulo 40

-

[This ought to be a comment on @Lucian’s answer, but I don’t have the 50 requisite points yet for that. So, here it is as answer.]

Although, mathematically, answers like lab bhattacharjee’s are preferable, because of their generality, for some problems, it’s worth getting your fingers dirty with actual digits and looking at how the power series plays out—what empirical scientists call “making friends with your data”.

In the case of powers of 9, the cycle of digits is very pretty. For units, they just alternate between 1 (for even powers of 9) and 9 (for odd powers). In the tens column, the digits are always even, hitting the lowest first (0), then the highest (8), then the next lowest (2), then the next highest (6), then landing on (4), before reversing the whole pattern:

08264 46280 08264 46280 08264 46280 ...

where the $2n+1$-th zero arises whenever the power of 9 equals 0 (mod 10).

Obviously, then, $9^{9^9} = 9^{81}$ ends in $89$, as $81 \equiv 1$ (mod $10$) and $81 \equiv 1$ (mod $2$).

As said, this way of looking at things has its limitations, but, in this instance, it happens to be rewarding to see what’s going on under the bonnet.

-