Trial division

Trial division tests whether an integer has nontrivial factors by checking candidate divisors up to its square root. It can also factor an integer by repeatedly testing primes.

Connect