by John on (#6ERP2)
Suppose m is a large integer that you are able to factor. To keep things simple, suppose m = pq where p and q are distinct primes; everything in this post generalizes easily to the case of m having more than two factors. You can carry out calculations mod m more efficiently by carrying out [...]The post Gaining efficiency by working modulo factors first appeared on John D. Cook.