gcd mod prime