Wednesday, 4 July 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

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...