3

I'm trying to solve 17y=1 (mod 57). Since gcd(17,57)=1 and 1 divides 1, they are relatively prime (coprime) and so the modulus equation above indicates that there will be a solution (exactly one residue class of mod57).

My first attempt:

17y≡1 (mod57)

(17x9)y≡1x9 (mod57)

153y≡9 (mod57)

(57x2+39)y≡9 (mod57)

39y≡9 (mod57)

(39x3)y≡9x3 (mod57)

117y≡27 (mod57)

(57x2+3)y≡27 (mod57)

3y≡27 (mod57)

y≡9 (mod19)

But this means that y≡9, 26, 47 (mod57) are all answers but this is impossible since there should only be one residue class? Note that 17x9=153≡39 in mod57 ≠ 1

IF I repeat with different numbers, e.g. my second attempt, I was able to obtain the correct solution:

17y≡1 (mod57)

(17x20)y≡1x20 (mod57)

340y≡20 (mod57)

(57x6-2)y≡20 (mod57)

-2y≡20 (mod57)

(-2x29)y≡20x29 (mod57)

-58y≡580 (mod57)

(57x(-1)-1)y≡57x10+10 (mod57)

-y≡10 (mod57)

y≡-10≡57-10≡47 (mod57)

Testing shows that 47+57n is indeed the general solution.

So, what did I do wrong during my first attempt?

Many thanks!!

  • Multiplying by nine introduced those other solutions because $9$ and $57$ share $3$ as a factor. – Jyrki Lahtonen Oct 02 '16 at 21:01
  • i.e. $\ bx\equiv c \Rightarrow abx\equiv ac,,$ but the reverse implication holds only if $,a,$ is coprime to the modulus. In fractional form (as in my answer), this cannot happen if one restricts to fractions with denominator coprime to the modulus. This is the modular generalization of avoidng division by zero (here zero-divisors). – Bill Dubuque Oct 03 '16 at 16:19

2 Answers2

2

Observe that

$$17\cdot10=170=3\cdot57-1\implies 17\cdot10=-1\pmod{57}\implies $$

$$\implies-10=47=17^{-1}\pmod{57}$$

and thus

$$17y=1\pmod{57}\implies y=17^{-1}\pmod{57}=47\pmod{57}$$

and observe that indeed $\;47=9\pmod{19}\;$...and you don't have any contradiction, but you hadn't yet answered your question.

DonAntonio
  • 211,718
  • 17
  • 136
  • 287
  • I only read the questions' titles...in particular questions which aren't written clearly. Yet the end of his first try was clear enough for me to read...and there it is. – DonAntonio Sep 30 '16 at 22:15
  • 1
    Having solutions modulo $;19;$ don't give you solutions modulo $;57;$ . If it were powers of primes then one can use Hansel lemma and etc. – DonAntonio Sep 30 '16 at 22:16
  • So does that mean that if I were to continue with my first attempt, I would need to test y=9, 28 AND 47 in order to detetmine what is the smallest positive y that satisfies the original modular equation (in mod57)? – Please help Sep 30 '16 at 22:24
  • @Pleasehelp Indeed so...but that can be a rather lengthy process. – DonAntonio Oct 01 '16 at 08:21
0

Hint $\ {\rm mod}\ 57\!:\,\ 17y\equiv 1\iff y\equiv \dfrac{1}{17}\equiv \dfrac{-56}{-40}\equiv \dfrac{7}{5}\equiv\dfrac{-50}{5}\equiv -10$


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


Remark $ $ Such fiddling often works well for small numbers. For larger moduli one may use the Extended Euclidean Algorithm. Given integers $\rm\,x,y\,$ it yields integers $\rm\,a,b\,$ such that $\rm\, ax+by = gcd(x,y)\ $ (Bezout's identity). Thus, when the gcd $=1,\,$

$$\ \rm ax+by = 1\ \Rightarrow\ ax\equiv 1\!\!\pmod y$$

yielding the inverse of $\rm\,x,\,$ modulo $\rm\,y,\,$ i.e. $\, \rm x^{-1} = 1/x\, \equiv\, a\pmod y$

Bill Dubuque
  • 272,048