Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Congruence of squares
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Derivation== Given a positive [[integer]] ''n'', [[Fermat's factorization method]] relies on finding numbers ''x'' and ''y'' satisfying the [[equation|equality]] :<math>x^2 - y^2 = n</math> We can then factor ''n'' = ''x''<sup>2</sup> β ''y''<sup>2</sup> = (''x'' + ''y'')(''x'' β ''y''). This algorithm is slow in practice because we need to search many such numbers, and only a few satisfy the equation. However, ''n'' may also be factored if we can satisfy the weaker '''congruence of squares''' conditions: :<math>x^2 \equiv y^2 \pmod{n}</math> :<math>x \not\equiv \pm y \,\pmod{n}</math> From here we easily deduce :<math>x^2 - y^2 \equiv 0 \pmod{n}</math> :<math>(x + y)(x - y) \equiv 0 \pmod{n}</math> This means that ''n'' [[divisor|divides]] the product (''x'' + ''y'')(''x'' β ''y''). The second non-triviality condition guarantees that ''n'' does not divide (''x'' + ''y'') nor (''x'' β ''y'') individually. Thus (''x'' + ''y'') and (''x'' β ''y'') each contain some, but not all, factors of ''n'', and the [[greatest common divisor]]s of (''x'' + ''y'', ''n'') and of (''x'' β ''y'', ''n'') will give us these factors. This can be done quickly using the [[Euclidean algorithm]]. Most algorithms for finding congruences of squares do not actually guarantee non-triviality; they only make it likely. There is a chance that a congruence found will be trivial, in which case we need to continue searching for another ''x'' and ''y''. Congruences of squares are extremely useful in integer factorization algorithms. Conversely, because finding [[Square root#In rings in general|square root]]s 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)