Skip to main content
\(\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{ #1}}{\thechapter~ #1}} \renewcommand{\sectionmark}[1]{} \newcommand{\abs}[1]{\left|#1\right|} \renewcommand{\theenumi}{5.\arabic{enumi}} \newcommand{\norm}[1]{\left\|#1\right\|} \newcommand{\norma}[1]{\left\|#1\right\|} \newcommand{\BM}[1]{\text{\boldmath$#1$}} \newcommand{\halmaz}[1]{\left\{\,#1\,\right\}} \newcommand{\halmazvonal}[2]{\left\{\,#1\mid #2\,\right\}} \newcommand{\halmazpont}[2]{\left\{\,#1:#2\,\right\}} \newcommand{\N}{\mathbb{N}} \newcommand{\len}{\norm} \newcommand{\var}[2][]{v_{#1}\left(#2\right)} \newcommand{\vari}[2]{v_{#1}\left(#2\right)} \newcommand{\size}[2][]{s_{#1}\left(#2\right)} \newcommand{\dep}[2][]{d_{#1}\left(#2\right)} \newcommand{\sizestar}[2][]{s_{#1}^*\left(#2\right)} \newcommand{\depstar}[2][]{d_{#1}^*\left(#2\right)} \renewcommand{\headrulewidth}{0pt} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section1.3The Euclidean algorithm

In this section we introduce the so-called Division algorithm, we define the greatest common divisor of given integers and we consider the Euclidean algorithm, which is one of the oldest mathematical algorithms.

Definition1.3.2

We say that \(b\) divides \(a\) (\(b\) is a divisor of \(a\) or \(a\) is a multiple of \(b\)) if there exists \(q\) such that \(a=qb\text{.}\) Notation: \(b\mid a\text{.}\)

How to find an appropriate \(q\) and \(r\text{?}\) Let us assume that we have two positive integers \(a\) and \(b\text{.}\) We start with \(q=0\) and \(r=a\text{.}\) Clearly \(a=0\cdot b+a\text{.}\) If \(a\lt b\text{,}\) then we are done, otherwise \(a-b\geq 0\text{.}\) So we write \(a=1\cdot b+(a-b)\text{.}\) We check if \(a-b\lt b\text{.}\) If this is the case then we have found \(q\) and \(r\text{,}\) otherwise we have \(a-2b\geq 0\) and \(a=2\cdot b+(a-2b)\text{.}\) We stop when we have \(a-kb\lt b\) for some \(k\text{.}\) For example, let \(a=76\) and \(b=7:\)

\(k\) \(a-kb\)
0 76
1 69
2 62
3 55
4 48
5 41
6 34
7 27
8 20
9 13
10 6

that is, we obtain that \(76=10\cdot 7+6\) and \(0\leq 6\lt 7\text{.}\)

Definition1.3.3

Let \(a,b\in\mathbb{Z}\text{.}\) A positive integer \(d\) is called a common divisor of \(a\) and \(b\text{,}\) if \(d\) divides \(a\) and \(d\) divides \(b\text{.}\) The largest possible such integer is called the greatest common divisor of \(a\) and \(b\text{.}\) Notation: \(\gcd(a,b)\text{.}\)

As an example we compute \(\gcd(553,161)\text{.}\) We write the computations in the following way:

\begin{align*} 553\amp =3\cdot 161+70 q_1=3, r_1=70\\ 161\amp =2\cdot 70+21 q_2=2, r_2=21\\ 70\amp =3\cdot 21+7 q_3=3, r_3=7\\ 21\amp =3\cdot 7+0 q_4=3, r_4=0\text{.} \end{align*}

That is, the last non-zero remainder is 7, so \(\gcd(553,161)=7\text{.}\) If we would like to express 7 as \(553x+161y\) for some \(x,y\in\mathbb{Z}\text{,}\) we can do it by working backwards

\begin{align*} 7\amp =70-3\cdot 21\\ \amp =70-3\cdot (161-2\cdot 70)=-3\cdot 161+7\cdot 70\\ \amp =-3\cdot 161+7 \cdot (553-3\cdot 161)=7\cdot 553-24\cdot 161\text{.} \end{align*}

It follows that \(x=7\) and \(y=-24\text{.}\)

Use the Euclidean algorithm to find \(\gcd(a,b)\) and compute integers \(x\) and \(y\) for which

\begin{equation*} ax+by=\gcd(a,b): \end{equation*}

(a) \(a=678, b=567\text{,}\)

(b) \(a=803, b=319\text{,}\)

(c) \(a=2701, b=2257\text{,}\)

(d) \(a=3397, b=1849\text{.}\)