0

So when I want the gcf of a,b I could use the euclidean algorithm for example.

But why is gcf (a mod b, a) = gcf (a,b) 

(because 0<=a<=b and in a mod b, a is always smaller than the rest from a mod b?)

So essentially my question is: how does the gcf(a mod b, a) work.

A dumb question:

why is the result of a mod b even smaller than a and how is that linked to the greatest common factor of a,b? 

Thank you.

2 Answers2

0

To answer your questions, you first need to understand modulo. $a' := a \mod{b}$ is defined as the unique number satisfying

  1. $0 \leq a' < b$
  2. $b \mid (a - a')$, where $\mid$ stands for "divides", so $b$ divides the difference of these two.

There are other equivalent ways to define it, but that's the most common one. You might know $a'$ as the rest obtained when dividing $a$ by $b$.

As an example, take $a = 12$ and $b = 5$. Then $a' = 2$, because that is the only number between $0$ and $4$ such that $a-a'$ is divisible by $5$. If $a > 0$, then of course we always have $a' \leq a$. Why is that you have asked, so let's see: $a$ itself always satisfies the second condition; any number $b$ is a divisor of $0$. So if we assume $0 \leq a < a' < b$, then that would mean there are two elements $a'$ and $a$ satisfying both conditions. But that can't be, the rest in a division is always unique. So we always must have $a \geq a'$.

Now for the other question on why the gcd is the same. We show something even stronger, we show that all common divisors stay. For that, let $c$ be a common divisor of $a$ and $b.$ Then $c$ also divides $a - a'$, and therefore $a'$, so $c$ is also a common divisor of $a'$ and $b$.
To see this more clearly, let's write the division by actually giving some values:

$c$ divides $a$, so we have $a = d_1c$ for some divisor $d_1$. The same goes for $b = d_2c$ for some other divisor $d_2$. Another one is obtained by the fact that $b$ divides $a - a'$, so there is some $d_3$ such that $a - a' = bd_3$.

Now we have all we need to proof that $c$ also divides $a'$. For that, we enter all the equations into one big one: $$ d_3d_2c = d_3(d_2c) = d_3b = a - a' = d_1c - a'.$$ Now take $d_1c$ to the other side to get: $$ a' = d_1c - d_3d_2c = (d_1 - d_2d_3)c$$ and there you have it, $c$ divides $a'$.

Because all divisors $c$ will divide $a'$, the greatest common divisor stays the same.

Note that I made this proof rather long to show multiple things that I hope will be helpful for you. There are shorter ways to proof this fact, depending on what you already know about divisors and gcds it might even be a single line proof.

Dirk
  • 6,359
0

You know that gcd(a,b)=gcd(a-b,a).

This can be proved as follows,

Let gcd(a,b) be k

So a=pk, b=qk, where p and q are coprimes.

Let gcd(a-b,a) be m.

So gcd(pk-qk,pk) is m

⇒ gcd(p-q,p)=1 (since p,q are coprimes)

Thus k=m, or gcd(a,b)=gcd(a-b,a)

Let a≡d (mod b)

Then a=nb+d,

Or d=a-nb

Now you can extend this argument to gcd(a,b)=gcd(a-nb,a) Or gcd(a,b)= gcd(d,a)

You can rewrite this as gcd( a mod b , a). Hope this answers your question.