Let $a, b ,n \in Z$ with $n > 0$ and $a \equiv b \pmod n$.
Show that $\gcd(a,n) = \gcd(b,n) = d$.
I tried rewriting $b = a + ny$ for some $y \in Z$. Now if I have $d \mid a$ and $d \mid n$, then $d \mid b$. However I don't know how to continue.
Let $a, b ,n \in Z$ with $n > 0$ and $a \equiv b \pmod n$.
Show that $\gcd(a,n) = \gcd(b,n) = d$.
I tried rewriting $b = a + ny$ for some $y \in Z$. Now if I have $d \mid a$ and $d \mid n$, then $d \mid b$. However I don't know how to continue.
Suppose $k$ divides $a$ and $n$. Since $a\equiv b\pmod n$, there exists $\ell$ such that $a-b=\ell n$. Then $b=a-\ell n$, and since $k$ divides $a$ and $n$, it divides $b$. Similarly, if $k$ divides $b$ and $n$ it also divides $a$. Now conclude result from here.