Below is text from the book Joseph H. Silverman: A Friendly Introduction to Number Theory, 4th Edition, chapter 8, page 56.
To solve
$4x\equiv 3 \pmod{19}$
we will multiply both sides by $5$. This gives
$20x\equiv 15 \pmod{19}$
But $20\equiv 1\pmod{19}$, so $20x\equiv x\pmod{19}$
Thus the solution is
$x\equiv 15\pmod{19}$
I was wondering if I can document the steps on how this is done to solve a generic congruence - I know this can be done only for solving congruences with small numbers
To solve
$Ax\equiv B \pmod{m}$
Find P & Q such that they satisfy the following conditions
- Q = A * n
- P = B * n
- $Q \equiv 1 \pmod{m}$
Once you do this - you can easily solve the congruence.
I have 2 questions
Is this correct - i.e. my description of the steps of how the example in the book was solved?
This seems to work when gcd(A, m) = 1. Will this work if the gcd is not 1.