Show that if $a\equiv b \pmod m$, then $\gcd(a,m)=\gcd(b,m)$

112 Views Asked by At

I still don't have a clear approach, but this is what I see.

$m \mid b$ and $m \mid a$ or $m\nmid b$ and $m\nmid a$.

I may think that the way is showing $\gcd(a,m)\leq\gcd(b,m)$ and $\gcd(a,m)\geq\gcd(b,m)$

2

There are 2 best solutions below

0
On

Note that if $d = gcd(a,m)\to d\mid a, d\mid m\to d\mid (a-b)\to d\mid ((b-a)+a) = b$.Thus $d \mid gcd(b,m)$.Similarly $gcd(b,m) \mid gcd(a,m)$.Thus they are equal.

0
On

Hint: using Bézout's identity $ka+tm = gcd(a,m)$ (1)

using $a\equiv b\pmod m$, $a = cm+b$

substitute into (1), $k(cm+b)+tb = (kc+t)m+tb = gcd(a,m)$

By this post: $gcd(b,m) | gcd(a,m) $

In a same way, $gcd(a,m) | gcd(b,m)$

=>$gcd(a,m) = gcd(b,m)$