1

I want to calculate $ 8^{-1} \bmod 77 $

I can deduce $ 8^{-1} \bmod 77$ to $ 8^{59} \bmod 77 $ using Euler's Theorem.

But how to move further now. Should i calculate $ 8^{59} $ and then divide it by $ 77 $ or is there any other theorem i can use ?

AlexR
  • 24,905
  • Are you sure the task is not to use the extended euclidean algoritm? If you are, you should use square-and-multiply to obtain the value, else you'll have a bad time with big numbers. – AlexR Feb 24 '15 at 10:32
  • Also, you can compute $8^{-1}$ modulo $7$ and modulo $11$, and then use the Chinese remainder theorem to combine the two. – Daniel Fischer Feb 24 '15 at 10:42

4 Answers4

3

Below are a few methods.


${\rm mod}\ 77\!:\ \ \dfrac{1}8\equiv \dfrac{-76}8\equiv \dfrac{-19}{2}\equiv \dfrac{58}2\equiv 29\,\ $ by fraction fiddling


${\rm mod}\ 77\!:\ \ \dfrac{1}8 \equiv \dfrac{10}{80}\equiv \dfrac{10}{3}\equiv\dfrac{87}3\equiv 29\,\ $ by Gauss's algorithm.


${\rm mod}\ 7\!:\,\quad 8\equiv 1\,\Rightarrow\, 8^{-1}\equiv 1.\ $

${\rm mod}\ 11\!:\,\ \dfrac{1}8\equiv \dfrac{12}{-3}\equiv -4\equiv \color{#0a0}{7}.\ $ Now we apply CRT.

${\rm mod}\ 7\!:\quad 1\equiv 8^{-1}\equiv \color{#0a0}{7}+11n\equiv 7-3n\iff 3n\equiv 6\iff n\equiv \color{#c00}2$

Thus we find $\,\ 8^{-1}\equiv 7+11(\color{#c00}2+7k)= 29+77k$


Beware $ $ Modular fraction arithmetic is well-defined only for fractions with denominator coprime to the modulus. See here for further discussion.

Bill Dubuque
  • 272,048
1

Your question is equivalent to solving $8x+77y=1$ for integers $x$ and $y$. This can be solved using the division algorithm, or alternatively (equivalently) solving modulo $8$ - which is small enough to do by trial and error or observation.

So noting that $77\equiv 5 \bmod 8$ and $5\times 5 \equiv 1 \bmod 8$ choose $y=5$ and then solve for $x$. Then adjust the answer by an appropriate multiple of $77$.

Mark Bennet
  • 100,194
1

For small to intermediate size moduli, you can use the method of adding the modulus, and cancelling when possible. (For larger moduli, you may want to use the extended Euclidean Algorithm.)

Here's adding the modulus on your problem:

$8x\equiv 1\equiv 78 \pmod{77}$. So $4x\equiv 39 \pmod{77}$.

Then $4x\equiv 39\equiv 116 \pmod{77}$. So $x\equiv 29 \pmod{77}$.

$8^{-1}\equiv 29\pmod{77}$

paw88789
  • 40,402
0

$$8\equiv 1 \bmod 7\implies 8^{-1}\equiv 8 \bmod 7$$ also $$7\times 8\equiv 1 \bmod 11\implies 8^{-1}\equiv 7 \bmod 11$$ Now apply the chinese remainder theorem. Or without this theorem you can write $$11\times 8^{-1}\equiv 88 \bmod 77$$ and $$7\times8^{-1}\equiv 49 \bmod 77$$ multiplying the latter by 2 and subtracting from the previous gives us $$3\times 8^{-1}\equiv 10 \bmod 77$$ now multiply both sides of this by $26$ $$78\times 8^{-1}\equiv 8^{-1}\equiv 260\equiv 29\bmod 77$$ i.e.,the inverse of $8$ $\bmod 77$ is $29$.

Fermat
  • 5,230