FIND ME ON

GitHub

LinkedIn

Euclidean Algorithm

🌱

Theorem
NumberTheory

Theorem

Given a,b∈Z,b=Ģø0a,b\in\mathbb{Z},b\not=0, then we can divide aa by bb such that ∃q,r\exists q,r, the quotient and remainder, such that a=bq+ra=bq+r with 0≤r<∣b∣0\le r<|b|. If r=0r=0, bb, is said to be a divisor of aa.

Note

This algorithm leads to the notion of the Greatest Common Divisor, where d=gcd(a,b)d=gcd(a,b) is the largest number that divided both aa and bb. # Algorithm The Euclidean (division) algorithm, allows us to find the gcd of any two numbers, a,b∈Za,b\in\mathbb{Z}. Noting that (a,b)=(b,r)(a,b)=(b,r) then we can recursively repeat the process until we reach a dead end (i.e.Ā ri=0r_{i}=0 for some iteration ii). Suppose the process terminates after k+1k+1 steps then a=qb+rb=q1r+r1ā‹®rkāˆ’2=qkrkāˆ’1+rkrk=(a,b)\begin{align*} a&=qb+r\\ b&=q_{1}r+r_{1}\\ \vdots\\ r_{k-2}&=q_{k}r_{k-1}+r_{k}&r_{k}=(a,b) \end{align*} This implies that ∃x,y∈Z\exists x,y\in\mathbb{Z} such that rk=ax+byr_{k}=ax+by.

Linked from