Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Let's say I have three known numbers : $a$, $b$ and $m$.

I want to find the smallest $x$ so that $a.x \equiv b\ (mod\ m)$ (the product of $a$ and $b$ is congruent to $b$ modulo $m$).

In the cases where such an $x$ exists, is there a simple equation that allows me to get the value for $x$ ?

Note: the numbers $a$, $b$ and $m$ can be very large numbers. I am looking for a direct resolution of the equation, not a solution involving iterating through all possible values of $x$ or modular-rewriting of $a$ and $b$.

share|improve this question
2  
There is no simple equation, but there is a simple and efficient algorithm, Euclid's. You'll probably find it explained in several earlier questions on this site. –  Gerry Myerson Aug 24 '12 at 12:45
    
Thanks for that, Gerry ! –  subtenante Aug 25 '12 at 10:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.