Factor d=p1a1 ... pmam, where pj are distinct odd primes. The Chinese Remainder Theorem tells us that the period of 1/d divides the Carmichael function λ(d)=lcm(φ(p1a1), ... , φ(pmam)), where φ is Euler's totient function.