Quantum physics

In Shor's factoring method, why is finding the order r of a chosen integer a modulo N useful?