Let be two natural numbers \( (a, b) \in \hspace{0.05em}\mathbb{N}^2, \enspace a > b \).
Euclid's algorithm tells us that:
$$ b / a \ \Longrightarrow \ a = bq \ \Longrightarrow \ PGCD(a, b) = b $$
$$ b \nmid a \ \Longrightarrow \ a = bq + R $$
The \( GCD(a, b) \) is the last non-zero \( R_n \) of the Euclidian division of \( a \) by \( b \) such as:
As long as the remainder does not divide the previous division divisor, we continue the algorithm.
We then decompose the new element at each step:
As long a the remainder \( R_{n - 1} \) still does not divide \( R_{n - 2} \), the remainder \( R_{n - 2} \) can be written:
Until the moment where finally \( R_n \) divides \( R_{n - 1} \), so \( R_{n - 1} \) will be written:
At this stage, as we trace back the algorithm injecting each previous step's values until \( a \) and \( b \), we realize that we can always factorize by \(R_{n} \). Thus:
\( \forall n \in \mathbb{N}\), \(\forall k \in [\![0, n ]\!] \), as long as the remainder \(R_{k} \) does not divide its predecessor \(R_{k -1 } \):
$$ a \nmid b \Longrightarrow GCD(a, b) = GCD(b, R_0) = GCD(R_0, R_1) = \enspace ... \enspace = GCD(R_{n - 1}, R_n) = R_n \neq 0$$
Let be two integers \( (a, b) \in \hspace{0.05em} \mathbb{N}^2 \), with \( a > b \).
Then, \( a \) can be written:
At this stage, as \( b /a \) and \( b/b \), so \( PGCD(a, b) = b\).
$$ b / a \ \Longrightarrow \ a = bq \ \Longrightarrow \ PGCD(a, b) = b $$
In this case, \( a \) can be written as:
So in a general way,
$$ b \nmid a \ \Longrightarrow \ a = bq + R $$
Then \( b \) can be written as:
We can reassemble the algorithm and inject \( (b) \) into \( (a^*) \):
So,
We then have,
$$ \Biggl \{ \begin{align*} a = Q_{a}R_0 \qquad (a') \\ b = q_1R_0 \qquad (b) \end{align*} $$
Ant at that moment, as \( R_0 /a \), \( R_0/b \) and \( R_0/R_0 \), so:
In this case, \( b \) can be written as:
Then \( R_0 \) can be written:
We can reassemble the algorithm and inject \( (R_0) \) into \( (b^*) \):
So,
We trace back the algorithm another time injecting the new value of \( (b') \) and \( (R_0) \) into \( (a^*) \):
We then have,
$$ \Biggl \{ \begin{align*} a = Q_{a}R_1 \qquad (a') \\ b = Q_{b}R_1 \qquad (b') \end{align*} $$
Now, as \( R_1 /a \), \( R_1/b \), \( R_1/R_0 \) and \( R_1/R_1 \), so:
In this cas, \( R_0 \) can be written as:
We continue the algorithm this way until \( R_n \) divides \( R_{n- 1} \) and then:
Thus, by tracing back the algorithm we get:
As a result, we have a chain reaction until the beginning of the algorithm:
\( R_n \) will be the greatest common divisor of all these numbers.
And finally,
\( \forall n \in \mathbb{N}\), \(\forall k \in [\![0, n ]\!] \), tant que le reste \(R_{k} \) ne divise pas le reste \(R_{k -1 } \):
$$ a \nmid b \Longrightarrow GCD(a, b) = GCD(b, R_0) = GCD(R_0, R_1) = \enspace ... \enspace = GCD(R_{n - 1}, R_n) = R_n \neq 0$$
This remainder \( R_n \) can itself be broken into different factors, which will make up the set of divisors of \( a \) and \( b \):
We have seen that it is necessary to carry out successive divisions, in order to recover the last non-zero remainder of this division series.
Calculation of \( 1365 / 25 \)
\( 25 \) does not divide \( 1365 \), because there is a remainder. We first recover its floor.
So \( 1365 \) can be written:
Let's calculate the remainder \( \textcolor{#446e4f}{R_0} \).
So,
Calculation of \( 25 / 15 \)
\( 15 \) does not divide \( 25 \).
Well \( 25 \) can be written:
Calculation of \( 15 / 10 \)
\( 10 \) does not divide \( 15 \).
Then \( 15 \) can be written:
Calculation of \( 10 / 5 \)
Now, \( 5 \) divides \( 10 \). The remainder is zero.
Then \( 10 \) can be written:
We therefore have a final result:
We can eventually go back through the algorithm and find two nuumbers that fit the Bézout's identity.
This theorem tell us thtat:
To do this, we will each time reinject the values into the result of the previous calculation.
$$ \Biggl \{ \begin{gather*} \underline{10} \hspace{0.1em} = \textcolor{#8E5B5B}{5} \times 2 \qquad (R_1) \\ 15 = \hspace{0.1em} \underline{\textcolor{#8E5B5B}{10}} \hspace{0.1em} \times 1 + \textcolor{#446e4f}{5} \qquad (R_0) \end{gather*} \enspace \Longrightarrow \enspace 15 = \textcolor{#8E5B5B}{(5 \times 2)} \times 1 + \textcolor{#446e4f}{5} \qquad (R_0') $$
We isolate the \( GCD \) value, because this is what we want in the end as a result.
Then, we do have this:
Injecting \( (R_1') \) into \( (R_2) \), we get:
$$ \Biggl \{ \begin{gather*} \textcolor{#446e4f}{5} = 15 - \hspace{0.1em} \underline{ \textcolor{#8E5B5B}{10} } \hspace{0.1em} \times 1 \qquad (R_2) \\ \hspace{0.1em} \underline{ \textcolor{#446e4f}{10} } \hspace{0.1em} = 25 - \textcolor{#8E5B5B}{15} \times 1 \qquad (R_1') \end{gather*} \enspace \Longrightarrow \enspace \textcolor{#446e4f}{5} = 15 - ( 25 - \textcolor{#8E5B5B}{15} \times 1 ) \times 1 \qquad (R_2') $$
Once again,
Now injecting twice \( (R_0'') \) into \( (R_2') \), we get:
$$ \Biggl \{ \begin{gather*} \hspace{0.1em} \underline{ \textcolor{#446e4f}{15} } \hspace{0.1em} = 1365 - \textcolor{#8E5B5B}{25} \times 54 \qquad (R_0'') \\ \textcolor{#446e4f}{5} = \hspace{0.1em} \underline{ 15 } \hspace{0.1em} - ( 25 - \hspace{0.1em} \underline{ \textcolor{#8E5B5B}{15} } \hspace{0.1em} \times 1 ) \times 1 \qquad (R_2') \end{gather*} \enspace \Longrightarrow \enspace \textcolor{#446e4f}{5} = 1365 - \textcolor{#8E5B5B}{25} \times 54 - ( 25 - ( 1365 - \textcolor{#8E5B5B}{25} \times 54 ) \times 1 ) \times 1 \qquad (R_2'') $$
So,
We definitely have:
$$ with \ \Biggl \{ \begin{gather*} u = 2 \\ v = -109 \end{gather*} $$