I have the ecuation:
$$42x \equiv 12 \text{ mod } 60$$
Using my logic the answer should be:
$x = \frac{43 \cdot ?}{12}=$ something $r$ $60$ but since that was an exam subject don't think that is so simple.
I have the ecuation:
$$42x \equiv 12 \text{ mod } 60$$
Using my logic the answer should be:
$x = \frac{43 \cdot ?}{12}=$ something $r$ $60$ but since that was an exam subject don't think that is so simple.
Since $(42,60)=6$, divide the equation by $6$: $7x\equiv2\pmod{10}$. Now these numbers are small enough to use a brute force approach, but we can also use the Euclid-Wallis implementation of the Euclidean Algorithm without first dividing: $$ \begin{array}{r} &&1&2&3\\\hline 1&0&1&-2&7\\ 0&1&-1&\color{#C00000}{3}&\color{#0000FF}{-10}\\ 60&42&18&\color{#00A000}{6}&0 \end{array} $$ This says that $(60,42)=6$ and $42\cdot\color{#C00000}{3}\equiv\color{#00A000}{6}\pmod{60}$. Multiply by $2$ to get $$ 42\cdot6\equiv12\pmod{60} $$ The last column says that we can add integer multiples of $\color{#0000FF}{-10}$ to this solution to get all the solutions.
Divide by 6 and get $7x \equiv 2 \pmod {10},\,$ with a solution $x\equiv 6 \pmod {10}$ - either by guessing or with $7^{-1}\equiv 3 \pmod {10}.\,$ Now verify that $6\times 42 \equiv 12 \pmod {60},\,$ i.e. $6$ is also a solution to your original problem (as indicated in the comments there are more solutions, actually $x\equiv 6+10k\pmod{60}, k=0\dots 5\,$).
First thing you can do here is simplify the problem by dividing through by 6.
i.e. if $42x \equiv 12$ mod $60$, then $7x \equiv 2$ mod $10$.
What does $2$ mod $10$ mean? It means that the number ends in a 2.
Hope this helps.