Fermat's factorization method: Difference between revisions

Content deleted Content added
mNo edit summary
bit of rewording
Line 1:
With [['''Fermat's factoringfactorization method]],''' oneis triesa torepresentation representof an [[even and odd numbers|odd]] [[integer]] as the difference of two squares:
:<math>N = a^2 - b^2.</math>.
That difference is algebraically[[algebra]]ically factorable as <math>(a+b)(a-b)</math>; if neither factor equals one, it is a proper factorization of ''N''.
 
Furthermore, eachEach odd number has such a representation. IfIndeed, if <math>N=cd</math> is a factorization of ''N'', then
:<math>N = [(c+d)/2]^2 - [(c-d)/2]^2.</math>.
Since ''N'' is odd, then ''c'' and ''d'' are bothalso 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 is even slower than trial division (on average). Nonetheless, the combination of trial division and Fermat's is more effective than either.