Using trial_division, using only primes upto sqrt(candidate)