Suppose we have to do an intense calculation, like calculating $a^b$ for large $a$ and $b$. Then, instead of multiplying $a$ by itself $b$ times, could we just do some shortcut method with $a$ and $b$ which gives us the units digit of $a^{b}$, then another algorithm which gives the tens digit and hence, could we find the answer digit-by-digit?
I mean, could we have a function $f$ or any algorithm which takes three inputs: $a$, $b$, and $n$, such that $f(a,b,n)$ gives us the $n^{th}$ digit of $a^b$?
Similarly, could we have another algorithm, which takes inputs $a$ and $n$ and gives us the $n^{th}$ digit of $a!$, i.e. calculating factorials digit-wise?
Maybe, it's like a divisibility test where you have an algorithm to check whether $a$ is divisible by $b$ without actually dividing $a$ by $b$. Maybe, binary could be of some help in digit-wise calculation, because in binary, all the digits can have only two possible values.