Home/Algebra/Modular arithmetic/Modular inverse26. Modular arithmeticModular inverseLevel: intermedioIn 26. Modular arithmeticFormulaCopy LaTeXaa−1≡1(modn) ⟺ gcd(a,n)=1aa^{-1}\equiv1\pmod n\iff\gcd(a,n)=1aa−1≡1(modn)⟺gcd(a,n)=1Tagsalgebraarithmetic modularCSalgebra formulamodularDetailThe inverse exists exactly when a and n are coprime.Explore the ideaFound an error? Contact us.Related formulasRelatedBézout's identityax+by=gcd(a,b)ax+by=\gcd(a,b)ax+by=gcd(a,b)Open formulaOpen in sectionRelatedPrime finite fieldFp=Z/pZ(p primo)\mathbb F_p=\mathbb Z/p\mathbb Z\quad(p\text{ primo})Fp=Z/pZ(p primo)Open formulaOpen in section