Finding the inverse of 84 mod 5

114 Views Asked by At

I did:

$$gcd(84,5) = \\ 84 = 5*16+4 \\ 5=4*1+1$$

$$4 = 84-5*16 \\ 1 = 5-4*1 \\ 1 = 5-(84-5*16)\\ 1 = 17*5-1*84$$

So the answer should be $1$ but it's 4, what went wrong?

2

There are 2 best solutions below

0
On BEST ANSWER

$1 = 17\cdot 5-1\cdot 84 = 17\cdot 5+(-1)\cdot 84$ tells us that the answer is $-1$, which is the same as $4$, mod $5$.

0
On

Observe that $84=4$ mod $5$. Thus $84 \times4=4\times4 $ mod $5$. Thus $84 \times4=16=1 $ mod $5$. Thus $4 $ mod $5$ is the inverse.