Empirically this equality holds:
$\gcd(10,8) = 2 $ and $\gcd(\operatorname{mod}(10,8),8) = \gcd(2,8) = 2 $
$\gcd(18,9) = 9 $ and $\gcd( \operatorname{mod}(18,9),9) = \gcd(0,9) = 9 $
I am stuck on how to prove it,though , and do not understand why this holds true.
$ \operatorname{mod}(a,b)=a-bk$ for some integer $k$. Therefore, $$\gcd( \operatorname{mod}(a,b),b)=\gcd(a-bk,b)=\gcd(a,b)$$
Would the last equality be also a problem for your?