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!!