Congruence of squares
From Wikipedia, the free encyclopedia
In number theory, a congruence of squares is a congruence commonly used in integer factorization algorithms.
[edit] Derivation
Given a positive integer , Fermat's factorization method relies on finding numbers satisfying the equality
- x2 − y2 = n
We can then factor . However, this algorithm is slow in practice because we need to search many such numbers, and only a few satisfy this strict equation. However, can also be factored if we satisfy the weaker congruence of squares
- .
From here we easily deduce
There is a good chance that will have common factor(s) with . Computing the greatest common divisors of and is enough to tell us whether we can extract a factorization from ; this can be done quickly using the Euclidean algorithm.
Congruences of squares are extremely useful in integer factorization algorithms. This congruence is extensively used in, for example, the quadratic sieve, general number field sieve, continued fraction factorization, Dixon's factorization, and so on.
[edit] Example
We take . We find that .
We can thus factor 35 using and .