Build a hash of factors and exponents in the exp-primes function.