Thursday, February 1, 2018

elementary number theory - What is the best algorithm for finding the last digit of an enormous exponent?

I found most answers here not clear enough for my case such as




$$
123155131514315^{4515131323164343214547}
$$



I wrote the $n\bmod10$ in Python and execution time ran out. So I need a faster algorithm or method. Sometimes, the result is incorrect as it failed the test case.

No comments:

Post a Comment

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...