ive had to solve $\,99x \equiv 18 \mod 30$
Firstly $\gcd(99,30)=3$ and $3 | 18$ so the equation has solutions.
I can devide by $3$. So we get:
$$33x \equiv 6 \mod 10$$
Since $\,\gcd(33,10)=1$ we can find an inverese to $33$ with the extended euclidean algorithm.
I calculated: $(-3)33+10*10=1$, so the inverse element should be $-3$
Now we write:
$$(-3)33x \equiv (-3)6 \mod 10$$
which should give:
$$x \equiv -18 \mod 10$$
So $x=10*p + 8$ with $p\in \mathbb{Z}$
But when I try out the found $x$ the solution is simply wrong..
Actually I found by trying out, $x = 12$ does work.. I am really confused where I messed it up :(
Can someone help? Thanks