For a number $a^{x^{...^n}} $. To find its last digit in a base b,
Imagine that I have this number $a^{x^{y}}$ to simplify the problem. Then I calculate $a^{x} \equiv c \pmod b$ and after that $c^{y} \equiv d \pmod b$ which means that d is the last digit. Am i right?
Thanks !
The procedure you suggest does not work since the conventional meaning of $a^{x^{y}}$ is that it means $a^{(x^{y})}$ whereas you were finding $(a^x)^{y}$.
Depending on the problem you wish to solve, it is likely that the best method for you would be to find a power $N$ of $a$ which is 1 modulo $b$ and then consider $x^y$ modulo $N$.