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
Extended Euclidean algorithm
(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!
=== Example === The following table shows how the extended Euclidean algorithm proceeds with input {{nowrap|{{green|240}}}} and {{nowrap|{{green|46}}}}. The greatest common divisor is the last non zero entry, {{nowrap|{{red|2}}}} in the column "remainder". The computation stops at row 6, because the remainder in it is {{nowrap|{{red|0}}}}. BΓ©zout coefficients appear in the last two columns of the second-to-last row. In fact, it is easy to verify that {{nowrap|1={{magenta|β9}} Γ {{green|240}} + {{magenta|47}} Γ {{green|46}} = {{red|2}}}}. Finally the last two entries {{nowrap|{{cyan|23}}}} and {{nowrap|{{cyan|β120}}}} of the last row are, up to the sign, the quotients of the input {{nowrap|{{green|46}}}} and {{nowrap|{{green|240}}}} by the greatest common divisor {{nowrap|{{red|2}}}}. {| class="wikitable" style="text-align:right;" ! index ''i''!! {{blue|quotient ''q''<sub>''i''β1</sub> }}!! {{olive|Remainder ''r''<sub>''i''</sub>}}!! {{brown|''s''<sub>''i''</sub> }}!! ''t''<sub>''i''</sub> |- | 0 || ||{{green|240}}||{{brown|1}} || 0 |- | 1 || ||{{green|46}} || {{brown|0}} || 1 |- | 2 ||{{green|240}} Γ· {{green|46}} = {{blue|5}} ||{{green|240}} β {{blue|5}} Γ {{green|46}} = {{olive|10}} ||{{brown|1}} β {{blue|5}} Γ {{brown|0}} = {{brown|1}} || 0 β {{blue|5}} Γ 1 = β5 |- | 3 ||{{green|46}} Γ· {{olive|10}} = {{blue|4}} ||{{green|46}} β {{blue|4}} Γ {{olive|10}} = {{olive|6}} ||{{brown|0}} β {{blue|4}} Γ {{brown|1}} = {{brown|β4}} || 1 β {{blue|4}} Γ β5 = 21 |- | 4 ||{{olive|10}} Γ· {{olive|6}} = {{blue|1}} ||{{olive|10}} β {{blue|1}} Γ {{olive|6}} = {{olive|4}} ||{{brown|1}} β {{blue|1}} Γ {{brown|β4}} = {{brown|5}} || β5 β {{blue|1}} Γ 21 = β26 |- | 5 ||{{olive|6}} Γ· {{olive|4}} = {{blue|1}} ||{{olive|6}} β {{blue|1}} Γ {{olive|4}} = {{red|2}} ||{{brown|β4}} β {{blue|1}} Γ {{brown|5}} = {{magenta|β9}} || 21 β {{blue|1}} Γ β26 = {{magenta|47}} |- | 6 ||{{olive|4}} Γ· {{olive|2}} = {{blue|2}} ||{{olive|4}} β {{blue|2}} Γ {{olive|2}} = {{red|0}} ||{{brown|5}} β {{blue|2}} Γ {{brown|β9}} = {{cyan|23}} || β26 β {{blue|2}} Γ 47 = {{cyan|β120}} |}
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)