
Fermat's factorization method
Fermat's factorization method is a way to find two numbers that multiply together to make a larger number, especially useful if the two factors are close together. It involves expressing the target number as a difference of two squares: n = a² - b², which factors as (a + b)(a - b). Starting with the smallest possible a (roughly the square root of n), you check if a² - n is a perfect square. If it is, you've found your factors: (a + b) and (a - b). If not, you increase a and repeat until a perfect square is found.