Trial division (source code)

= Trial division
{wiki=Trial_division}

Trial division is a simple method for finding the prime factors of a number or determining whether a number is prime. It involves dividing the number by successive integers and checking for divisibility. Here’s how it works: 1. **Start with a target number (n)**: Begin with the number you want to factor or test for primality.