Implement prime factorization solver.