This function finds the small prime factors of an integer. It simply
tries dividing by all primes up to the given bound. The result is a
list of the prime factors found together with the unfactored part of N.
Be careful about supplying large values for MaxP (e.g. greater than a
million): the function could take a very long time. MaxP must be positive.