You are viewing a single comment's thread. Return to all comments →
Is this going into the right direction?
What can you do if gcd(a, m) > 1
I tried using phi(m) in all cases, but I get incorrect results (as expected), but not reducing the size of the exponent, even if I do so, only when gcd > 1, still gets me timeouts.
Note: I already stop the recusion if m = 1;