-1

how can I calculate $ d = 17^{-1} (\text{mod} ~ 60) $ ? I was reading this article and then I wrote down this steps:

60 = 3 * 17 + 9
17 = 1 * 9 + 8
9 = 1 * 8 + 1

In the end (using EEA) I get x = -1 and y = 4. But if I insert x, y like this way: $60 * -1 + 17^{-1} * 4 $ I dont get 0.588..

What do I wrong?

Best :D

Sam
  • 23
  • The first part is fine. Then you have to back up: $1=9-8=9-(17-9)=2\cdot9-17$ $=2(60-3\cdot17)-17=2\cdot60-7\cdot17$. So $17\cdot(-7)=1\bmod60$ or if you prefer $17\cdot53=1\bmod60$. – almagest May 07 '16 at 16:57
  • 8
    Surely you are aware that Google is computing $ 1/17 $ as a rational number (i.e in the field $\mathbb{Q}$) and not in the ring $\mathbb{Z}/60\mathbb{Z}$? – Ege Erdil May 07 '16 at 16:57
  • What Starfall said. If you want to do this kind of calculations, use Wolfram Alpha. – Wojowu May 07 '16 at 16:58
  • @almagest Hey thanks for your answer, so d = 53? I'm a little bit confuse in the moment. – Sam May 07 '16 at 16:58
  • @Sam Check it for yourself: $17\cdot 53=901=15\cdot60+1$. – almagest May 07 '16 at 17:00
  • @Starfall I dont know :( – Sam May 07 '16 at 17:01
  • I will do it, thanks @almagest – Sam May 07 '16 at 17:01
  • Make up your mind. Which one do you want: the inverse of $17$ modulo $60$, or $\frac 1 {17}$ as a decimal number? – Alex M. May 07 '16 at 17:03
  • You didn't go for enough. You got $8 = -60 + 417$. Needed to go one step further. $60=317 + 9 => 9 = 60 - 317$. $17 = 9 + 8 => 8 = 17 - 9 = 17 - (60 - 317) = -60 + 417$. $9 = 8 + 1 => 1 = 9 - 8 = (60-317) - (-60+417) = 260 - 717$. So $1/17 \equiv -7 \equiv 53 \mod 60$. And, indeed, $5317 = 6017 - 717 = 6017 - 119 = 6017 - 120 + 1 = 60*15 + 1$. – fleablood May 07 '16 at 18:33

3 Answers3

1

$60 = 17\cdot 3 + 9$
$17 = 9\cdot 1 + 8$
$9 = 8\cdot1 + 1$

$1 = (9 - 8) = (9 - (17 - 9)) = (2\cdot 9 - 17) = (2\cdot (60-17\cdot 3) -17) = 2\cdot 60 - 7\cdot 17$

So $17\cdot -7 \mod_{60} = 1$

Thus $53$ is the inverse.

Rustyn
  • 8,407
0

Here is the (simplified) layout of the EEA: $$\begin{array}{cccc} r_i&u_i&v_i&q_i\\ \hline 60&0&1\\17&1&0&3\\\hline 9&-3&1&1\\8&4&-1&1\\1&-7&2\\\hline \end{array}$$ where $r_i, q_i$ are the remainder and quotient at step $i$ of the Euclidean algorithm, and $u_i,v_i$ are the Bézout's coefficients of each of the remainders. The recurrence relation is $$u_{i+1}=u_{i-1}- q_iu_i,$$ and similarly for the $v_i$s.

The result of this algorithm says that$\;-7\cdot 17+2\cdot 60=1$, whence $-7\cdot 17\equiv 1\mod 60$. This means $17^{-1}\equiv-7\equiv 53\mod 60$.

Bernard
  • 175,478
0

You didn't go far enough.

$60 = 3*17 + 9 \implies 9 = 60 - 3*17$

$17 = 9 + 8 \implies 8 = 17 - 9 = 17 - (60-3*17) = 4*17 - 60$

This is as far as you went. Need to go one step further.

$9 = 8 + 1 \implies 1 = 9 - 8 = (60-3*17) - (4*17 -60) = 2*60 - 7*17$

So $-7*17 \equiv 1 \mod 60$ and $-7 \equiv 53 \equiv \frac 1 {17} \mod 60$.

(To get an x,y with y = 53 rather than -7: $1= 2*60 - 7*17 = 2*60 - 7*17 + 60*17 - 60*17= (2-17)*60 + 53*7 = -15*60 + 53*17$)

I don't understand what $60*2 - 7/17$ is supposed to signify.

But $60*2 - 7*17 = 1$ so $60*2/17 - 7 = \frac 1{17}=.058...$ for what that's worth.

... and $60*\frac{-15}{17} + 53 = \frac 1{17}= .058...$.

fleablood
  • 124,253