check isprime before trial division loop in factor