The units digit of $(((\dots((2018^{2017})^{2016})^{.^{.^{.}}})^3)^2)^1$

elementary-number-theoryexponentiationmodular arithmeticpower-towers

I posted a problem, I got the answer from many guys, thanks for them.

This is another problem, I am curious how to solve it.

I tried to use modular arithmetic as in the problem linked above, but I really got confused.

How to find the units digit of
$(((\dots((2018^{2017})^{2016})^{.^{.^{.}}})^3)^2)^1$?

What I think is: we will reach some point in $(2018,2)$ where the units digit of the given expression is $0$, then it will remains $0$ until we reach the power $1$. Therefore, the units digit of the given expression is $0$. I am not sure about this.

If I am right, then how to find the last non-zero digit of the given
expression?

Best Answer

We have:

$$2018^{2017} \equiv 8^1 \equiv 8 \pmod {10}$$

and similarly,

$$8^{2016} \equiv 8^4 \equiv 6 \pmod {10}$$

However, $6^n \equiv 6 \pmod {10}$ for any natural number $n$, so the units digit will be just $6$.