Change common.primes.factor to return power of factor.