In number theory, integer factorization is the decomposition of a composite number into a product of smaller integers. If these integers are further restricted to prime numbers, the process is called prime factorization

Factorization Algorithms

The method will work, but will be slow. “How big are your numbers?” determines the method to use: