def inverse_modulaire(a,m): if pgcd(a,m)>1: return None else: return m+bezout(a,m)[0]