.
Hello, dave52!
$\displaystyle \text{(a) Find }\,2^{3^{100}}\text{ (mod 5)}$
$\displaystyle \text{(b) Find the last digit of }\,2^{3^{100}}$
Here is the first one . . .
Consider the first few powers-of-2:
. . $\displaystyle \begin{array}{ccc} 2^1 &\equiv& 2\text{ (mod 5)} \\ 2^2 & \equiv& 4\text{ (mod 5)} \\ 2^3 &\equiv& 3\text{ (mod 5)} \\ 2^4 &\equiv& 1\text{ (mod 5)} \\ 2^5 &\equiv& 2 \text{ (mod 5)} \\ \vdots && \vdots \end{array}$
We see that the powers-of-2 have a cycle of 4 steps.
Now what about $\displaystyle 3^{100}\,?$
We find that: .$\displaystyle 3^{10} \:=\:59,\!049 \:\equiv\:1\text{ (mod 4)}$
. . . . . . And:.$\displaystyle \left(3^{10}\right)^{10} \:\equiv\:1^{10} \:\equiv\:1\text{ (mod 4)}$
. . . . Hence: .$\displaystyle 3^{100} \:=\:4k+1$, for some integer $\displaystyle k.$
So we have: .$\displaystyle 2^{3^{100}} \;=\;2^{4k+1} \;=\;2^{4k}\cdot2^1 \;=\;(2^4)^k\cdot 2 $
Therefore: .$\displaystyle (2^4)^k\cdot2 \;\equiv\;1^k\cdot2\text{ (mod 5)} \;\equiv\;2\text{ (mod 5)}$
There are two interpretations of 2^3^100
1. As above and with most calculators $\displaystyle 2^{3^{100}}$; mod 5, this is 2 as above. So the last digit d is 2. Note to calculate 3^100 mod 4, it's probably easier to notice 3 is -1 mod 4, so 3^100 is (-1)^100 = 1 mod 4.
2. $\displaystyle 2^{3\cdot 100}$ -- this is treating ^ as associating left to right; i.e. a^b^c is (a^b)^c as opposed to 1 where it's a^(b^c). Here, though, 300 is 0 mod 4 and so 2^{300} is 1 mod 5. Then the last digit d is 0 mod 2, and by the Chinese remainder theorem, d is 6.