1 2 3 4 5 6
def gcd(p,q): while q != 0: p, q = q,p%q return p def is_coprime(x,y): return gcd(x,y) == 1