how to calculate a^(b^c) mod n? [duplicate]
问题 This question already has answers here : finding a^b^c^… mod m (6 answers) The most efficient way to implement an integer based power function pow(int, int) (17 answers) Closed 6 years ago . Can someone tell me the efficient way to solve this problem ? a b c mod m a, b, c, and m are 32 bit int where m is not a prime number and a is not coprime to m ?I've looking for the answer, but haven't found it There are some answered questions that familiar with this question, but none of them can