PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: Very high Entry average rating: No information on entry rating
[parent] Euclid's coefficients (Algorithm)

The following program is based on Euclid's algorithm and it determines Euclid's coefficients $t$ and $d$ of the integers $x$ and $y$

INPUT $x$ $y$     {positive integers}
$m := x$     $n := y$ $b := 0$     $d := 1$ $p := 1$     $t := 0$ WHILE $m \neq 0$ DO
BEGIN
$q := n$ DIV $m$     {integer division}
$h := m$     $m := n-qm$     $n := h$ $h := b$     $b := d-qb$     $d := h$ $h := p$     $p := t-qp$     $t := h$ END
WRITE -- The gcd of the numbers $x$ and $y$ is $n = tx+dy$

Remark. The values of $t$ and $d$ produced by the program have the absolute values as close each other as possible (Proof = ?). They differ very often only by 1 when $x$ and $y$ are two successive prime numbers, e.g. $$1 \,=\, 30\cdot523-29\cdot541.$$




Anyone with an account can edit this entry. Please help improve it!

"Euclid's coefficients" is owned by pahio.
(view preamble | get metadata)

View style:

See Also: Bezout's lemma (number theory)

Keywords:  integers, gcd

This object's parent.

Attachments:
Python code to calculate Euclid's coefficients (Algorithm) by drini
Log in to rate this entry.
(view current ratings)

Cross-references: prime numbers, proof, absolute values, numbers, gcd, integers, Euclid's algorithm
There is 1 reference to this entry.

This is version 11 of Euclid's coefficients, born on 2005-05-11, modified 2005-06-13.
Object id is 7038, canonical name is EuclidsCoefficients.
Accessed 1669 times total.

Classification:
AMS MSC11A05 (Number theory :: Elementary number theory :: Multiplicative structure; Euclidean algorithm; greatest common divisors)

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add example | add (any)