1

(A) Use the Euclidean Algorithm to find $\gcd (57, 139)$.
(B) Use your work from part (a) to write your gcd as a linear combination of the two numbers.
(C) Find the inverse of $57$ in $U(139)$.

I know the gcd is $1$ and can do part (A) fine. I know I am supposed to "work backwards," but keep getting confused.

Thank you in advance!

Kevin Long
  • 5,159
  • Write out how you did part (a). If you used the Euclidean algorithm, then you should be able to get the answer from that. – Kevin Long Oct 18 '16 at 20:20
  • Bill Dubuque has a lovely answer that uses row reduction of matrices to apply the extended Euclidean algorithm, which you can find here. – Viktor Vaughn Oct 18 '16 at 22:25
  • $139\quad 57\quad 25\quad 7\quad 4\quad 3\quad {\large\color{#f00}{1}}\quad 0\qquad$ from elementary school. – Felix Marin Oct 18 '16 at 23:30

5 Answers5

1

Working backwards is a pain in the neck. It's trivial in theory but I always screw it up in practice.

$139 = 2(57) + 25$ and $25=139-2(57)$

$57 = 2(25) + 7$ and $7 = 57 - 2(25) = 57 - 2(139 - 2(57)) = 5*57 - 2*139$

$25 = 3(7) + 4$ and $4 = 25 - 3(7)=(139-2(57)) - 3(5*57 - 2*139) = 7*139 -17*57 $

$7 = 1(4) + 3$ and $3 = 7 - 1(4)=(5*57 - 2*139)-(7*139 -17*57)= 22*57-9*139$

$4 = 3 + 1$ and $1 = 4 - 3= (7*139 -17*57) - (22*57-9*139) =16*139 - 39*57$

C) I'm not familiar with the terminology but I'm assuming the mean something like $57a \equiv 1 \mod 139$?

So $16*139 - 39*57 = 1$ so

$-39*57 \equiv 1 \mod 139$

so $(139-39)*57 = 100*57 \equiv 1 \mod 139$

so $57^{-1} = 100$

....

And indeed...

$1 = 16*139 - 39*57$

$1 = 16*139 -139*57 + 139*57 - 39*57$

$1 = -41*139 + 100*57$

$57*100 = 1 + 41*139$

fleablood
  • 124,253
0

You have the extended Euclidean algorithm to obtain directly the answer: $$ \begin{array}[t]{r@{}>{{}}l@{\qquad}rrr} \text{Successive Divisions}&& r_i & u_i & v_i & q_i\\ \hline & & 139 & 0 & 1 & \\ 139 & = {\color{red}2} × 57 +\color{blue}{25} & 57 & 1 & 0 & \color{red}{2} \\ \hline 57 & = {\color{red}2} \times {\color{blue}{25}} + \color{blue}{7} & 25 & -2 & 1 & \color{red}2 \\ 25 & = {\color{red}3} × \color{blue}{7}+\color{blue}{4} & 7 & 5 &-2 & \color{red}3 \\ 7 & = {\color{red}1} × \color{blue}{4}+\color{blue}{3} & 4 & -17 &7 & \color{red}1\\ 4 & = {\color{red}1} × \color{blue}{3}+\color{blue}{1} & 3 & 22 &-9 & \color{red}1\\ &&1 &-39&16\\ \hline \end{array}$$

Thus $\;1=-39\times57+16\times139$ and $\;57^{-1}=-39\equiv \color{red}{100}\mod 139$.

Bernard
  • 175,478
0

Part One.$$139=57(2)+25.$$ $$ 57=25(2)+7.$$ $$25=7(3)+4.$$ $$ 7=4(1)+3.$$ $$ 4=3(1)+1.$$ Part Two. $$(i).\; 3=4-1\implies 7=4(1)+(4-1)\implies 7=4(2)-1\implies 4(2)=7+1.$$ $$(ii).\; 25=7(3)+4\implies 25(2)=7(6)+4(2)=7(6)+(7+1)=7(7)+1\implies$$ $$\implies 25(2)-1=7(7).$$ $$(iii).\;57=25(2)+7\implies 57(7)=25(14)+7(7)=$$ $$=25(14)+(25(2)-1)=25(16)-1\implies 57(7)+1=25(16).$$ $$(iv).\; 139=57(2)+25\implies 139(16)=57(32)+25(16)=$$ $$=57(32)+(57(7)+1)=57(39)+1.$$ $$ \text {Therefore }\quad 139(16)+57(-39)=1.$$ Another method to find $A,B$ such that $57A+139B=1$: Modulo $139$ we have $$57(3)\equiv 32.$$ $$ 32(5)\equiv 21.$$ $$ 21(7)\equiv 8.$$ $$8(18)\equiv 5.$$ $$5(28)\equiv 1.$$ Therefore $$57(3)(5)(7)(18)(28)\equiv 1.$$ And calculate that $(3)(5)(7)(18)(28)\equiv (3)(7)(18)(140)\equiv (3)(126)\equiv (3)(-13)=-39.$ So let $A=-39$ and let $B=[1-57A]/139]=16.$ Then $57A+139B=1.$

0

Let's try forward, then:

$$\begin{matrix}139-2\cdot57&=\color{green}{25},\\ 57-2\cdot25&=\color{green}{7}&=57-2\cdot(139-2\cdot57)&=-2\cdot139+5\cdot57,\\ 25-3\cdot7&=\color{green}{4}&=(139-2\cdot57)-3\cdot(-2\cdot139+5\cdot57)&=7\cdot139-17\cdot57,\\ 7-4&=\color{green}{3}&=(-2\cdot139+5\cdot57)-(7\cdot139-17\cdot57)&=-9\cdot139+22\cdot57,\\ 4-3&=\color{green}{1}&=(7\cdot139-17\cdot57)-(-9\cdot139+22\cdot57)&=16\cdot139-39\cdot57.\end{matrix}$$

0

I like to work forwards. Let $a=139,b=57.$

$139=2(57)+(25)\implies25=139-2(57)=a-2b$

$57=2(25)+(7)\implies7=57-2(25)=b-2(a-2b)=5b-2a$

$25=4(7)-3\implies3=4(7)-25=4(5b-2a)-(a-2b)=22b-9a$

$7=2(3)+(1)\implies1=7-2(3)=(5b-2a)-2(22b-9a)=16a-39b$

So $1\equiv-39\cdot57\equiv18\cdot57\pmod{130}.$

bof
  • 78,265