I would like to have an implementation in PARI/GP for the calculation of
a_1 ^ a_2 ^ ... ^ a_n (mod m)
which manages all cases, especially the cases where high powers appear in the phi-chain.
Does anyone know such an implementation ?
来源:https://stackoverflow.com/questions/21305782/is-there-an-algorithm-known-for-power-towers-modulo-a-number-managing-all-cases