CONGRUENCE OF SQUARES
In number theory, a 'congruence of squares' is a congruence commonly used in integer factorization algorithms.
Given a positive integer ''n'', Fermat's factorization method relies on finding numbers ''x'', ''y'' satisfying the equality
:
We can then factor ''n'' = ''x''2 - ''y''2 = (''x'' + ''y'') (''x'' - ''y''). However, this algorithm is slow in practice because we need to search many such numbers, and only a few satisfy this strict equation. However, ''n'' can also be factored if we satisfy the weaker '''congruence of ''squares'''
:.
From here we easily deduce
:
There is a good chance that ''n'' will have common factor(s) with (''x'' + ''y'') (''x'' - ''y''). Computing the greatest common divisors of (''x'' + ''y'', ''n'') and (''x'' - ''y'', ''n'') is enough to tell us whether we can extract a factorization from ''x'', ''y''; 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.
We take ''n'' = 35. We find that
:.
We can thus factor 35 as gcd(6 - 1, 35) = 5 and gcd(6 + 1, 35) = 7.
| Contents |
| Derivation |
| Example |
Derivation
Given a positive integer ''n'', Fermat's factorization method relies on finding numbers ''x'', ''y'' satisfying the equality
:
We can then factor ''n'' = ''x''2 - ''y''2 = (''x'' + ''y'') (''x'' - ''y''). However, this algorithm is slow in practice because we need to search many such numbers, and only a few satisfy this strict equation. However, ''n'' can also be factored if we satisfy the weaker '''congruence of ''squares'''
:.
From here we easily deduce
:
There is a good chance that ''n'' will have common factor(s) with (''x'' + ''y'') (''x'' - ''y''). Computing the greatest common divisors of (''x'' + ''y'', ''n'') and (''x'' - ''y'', ''n'') is enough to tell us whether we can extract a factorization from ''x'', ''y''; 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.
Example
We take ''n'' = 35. We find that
:.
We can thus factor 35 as gcd(6 - 1, 35) = 5 and gcd(6 + 1, 35) = 7.
This article provided by Wikipedia. To edit the contents of this article, click here for original source.
psst.. try this: add to faves

العربية
中国
Français
Deutsch
Ελληνική
हिन्दी
Italiano
日本語
Português
Русский
Español