Find $a$ and $m$ for a given $x$ so that $ax≡1(mod(m))$

346 Views Asked by At

When the $\gcd(a,m)=1$, we know that $ax≡1\mod(m)$ does have an inverse in $m$. Normally $a$ and $m$ are given and $x$ must be found. How can I find $a$ and $m$ when only $x $ is given so that $ax≡1(\mod(m))$?

For example when I choose $x=1337$ one solution would be $36290x=1(\mod (48519729))$.

2

There are 2 best solutions below

2
On BEST ANSWER

Take any $a\neq 0$ you like, and let $m$ be any divisor of $ax-1$.

For example, with $x=1337$, take $a=731$, note that $$731\times 1337-1=977346 = 2\times 3^5\times 2011$$ and we might take $m=2011$ or we could take $m= 977346$ and so on.

0
On

If $x$ is given, let$ a=1 $and$ m=x-1$ is also solution to this question. We can find many values of $m$ and$ a$