[Math] What are the methods of solving linear congruences

elementary-number-theory

I have been trying very hard to solve this type of congruence equation:
$$ax = b \pmod n$$
and finally managed to actually solve a few by using properties like
$$\text{if}\quad
\begin{cases}
ax=b \pmod n \\
cx=d \pmod n
\end{cases}
\quad\text{then}\quad acx = bd \pmod n$$

but still there are some simple congruences which I am not able to solve like $$25x=15\pmod{29}.$$

I tried to make use of both the above and transitive property of congruences, but that is not working here.

Now, I wanted to ask if there is any other method to solve congruences. I am asking this because I have very little knowledge of congruences. I have Burton's book of number theory and that helped me much better than Zuckerman's text did. But, still there are some topics that I am not able to do yet.

Best Answer

$$25x\equiv 15\pmod{29}\tag{1}$$

$29$ is a prime number, an one can show (I think Gauss showed) that that implies every number in $\{1,2,3,\ldots,28\}$ must have a mod-$29$ multiplicative inverse within that set. So let's find the inverse $y$ of $25$, so that $25y\equiv1\pmod{29}$, and then multiply both sides of $(1)$ by $y$, getting $$ x\equiv15y\pmod{29}. $$ We want: $$ \begin{align} 25y & \equiv 1 \pmod {29} \\ 25y & = 1 - 29z \\ 25y+29z & = 1. \end{align} $$

If we divide $29$ by $25$, we get $1$, with remainder $4$: $$ 29-\{1\}25 = 4\tag{2} $$ Now divide $25$ by $4$, getting $6$, with remainder $1$: $$ 25-\{6\}4 = 1\tag{3} $$ Because $(2)$ is true, we can put $29-\{1\}25$ in place of $4$ in $(2)$: $$ 25-\{6\}(29-\{1\}25). $$ Now collect the $29$s and $25$s: $$ -\{6\}29 + \{7\}25 = 1.\tag{4} $$ So we have $y=7$ and $z=-6$.

Thus $(4)$ tells us that $$ 7\cdot25\equiv 1\pmod{29} $$

Thus multiply both sides of $(1)$ by $7$: $$ x\equiv7\cdot15\equiv 18 \pmod{29}. $$ See Calculating the Modular Multiplicative Inverse without all those strange looking symbols for the way to find the inverse of $322$ mod $701$. It turns out to be $455$.

Related Question