Slight performance improvement. Since the factorise function is intended to be used for large semi-primes, as soon as we find one factor we should jump out of the loop and use division to find the other.