We can then factor n = x^{2} - y^{2} = (x + y)(x - y). This algorithm is slow in practice because we need to search many such numbers, and only a few satisfy the strict equation. However, n may also be factored if we can satisfy the weaker congruence of squares condition:

$x^{2}\equiv y^{2}{\pmod {n}}$

$x\not \equiv \pm y{\pmod {n}}$

From here we easily deduce

$x^{2}-y^{2}\equiv 0{\pmod {n}}$

$(x+y)(x-y)\equiv 0{\pmod {n}}$

This means that n divides the product (x + y) (x - y). Thus (x + y) and (x − y) each contain factors of n, but those factors can be trivial. In this case we need to find another x and y. Computing the greatest common divisors of (x + y, n) and of (x - y, n) will give us these factors; this can be done quickly using the Euclidean algorithm.

Congruences of squares are extremely useful in integer factorization algorithms and are extensively used in, for example, the quadratic sieve, general number field sieve, continued fraction factorization, and Dixon's factorization. Conversely, because finding square roots modulo a composite number turns out to be probabilistic polynomial-time equivalent to factoring that number, any integer factorization algorithm can be used efficiently to identify a congruence of squares.

It is also possible to use factor bases to help find congruences of squares more quickly. Instead of looking for $\textstyle x^{2}\equiv y^{2}{\pmod {n}}$ from the outset, we find many $\textstyle x^{2}\equiv y{\pmod {n}}$ where the y have small prime factors, and try to multiply a few of these together to get a square on the right-hand side.

Using n = 1649, as an example of finding a congruence of squares built up from the products of non-squares (see Dixon's factorization method), first we obtain several congruences

$41^{2}\equiv 32{\pmod {1649}}$

$42^{2}\equiv 115{\pmod {1649}}$

$43^{2}\equiv 200{\pmod {1649}}$

of these, two have only small primes as factors

$32=2^{5}$

$200=2^{3}\cdot 5^{2}$

and a combination of these has an even power of each small prime, and is therefore a square

## No comments:

## Post a Comment