Inverse modulo function

5k Views Asked by At

How can we calculate the inverse of a modulo function, now I have a problem given me $f(n)=(18n+18)\mod29$, need find inverse of $f(n)$ ? how is the process to do it?

2

There are 2 best solutions below

2
On BEST ANSWER

You have to check that $\gcd(18,29)=1$. As $29$ is prime, this is obvious. Hence this is a bijection.


Using our friend Wolfram alpha you solve the equation: $$ 18y + 18 = x \mod 29 \\ y+1 = 21x \mod 29 \\ y = 21x+28\mod 29 $$ and you find: $$ f^{-1}(x) = 21x+28 $$

0
On

$\gcd(29,18)=1,\,$ so $\ {\rm mod}\ 29\!:\ \color{#c00}{18^{-1}}$ exists, so $\ m\equiv 18(n\!+\!1)\iff n\equiv \color{#c00}{18^{-1}} m - 1,\ $ and

$$ {\rm mod}\ 29\!:\ \color{#c00}{\dfrac{1}{18}} \,\equiv\, \dfrac{30}3\dfrac{30}6 \,\equiv\, 10\cdot 5\,\equiv\, 21\equiv -8$$