Fermat's Factorization Method

Fermat's factorization method, named after Pierre de Fermat, is based on the representation of an odd integer as the difference of two squares:

That difference is algebraically factorable as ; if neither factor equals one, it is a proper factorization of N.

Each odd number has such a representation. Indeed, if is a factorization of N, then

Since N is odd, then c and d are also odd, so those halves are integers. (A multiple of four is also a difference of squares: let c and d be even.)

In its simplest form, Fermat's method might be even slower than trial division (worst case). Nonetheless, the combination of trial division and Fermat's is more effective than either.

Read more about Fermat's Factorization Method:  The Basic Method, Fermat's and Trial Division, Sieve Improvement, Multiplier Improvement, Other Improvements

Famous quotes containing the word method:

    Government by average opinion is merely a circuitous method of going to the devil; those who profess to lead but in fact slavishly follow this average opinion are simply the fastest runners and the loudest squeakers of the herd which is rushing blindly down to its destruction.
    Thomas Henry Huxley (1825–95)