pgcd
def pgcd(a, b): for i in str(a): if i == ".": return None for i in str(b): if i == ".": return None if a == 0 and b == 0: return "plus l'infini" elif b == 0: return abs(a) elif a == 0: return abs(b) elif a < b: a, b = b, a while a % b != 0: c = a a = b b = c % b return abs(b) def exo_33(): for x in range(1, 277): for y in range(1, 277): if pgcd(x, y) == 1 and x * y == 276: print(23*x, y) print(x, 23*y) def exo_34_1(): for m in range(1, 361): for n in range(1, 361): if pgcd(m, n) == 1 and m * n == 360: print(m, 15*n) print(15*m, n) def exo_34_2(): for m in range(1, 1621): for n in range(1, 1621): if m**2 - n**2 == 1620 and pgcd(m, n) == 6: print(m, n)