#coprime test def gcd(m,n): q = m%n if q ==0: return n else: return gcd(n, q) def iscoprime(a,b): return gcd(a,b) == 1
without recursion,
def gcd(m,n): while m%n != 0: m, n = n, m%n return n