I have two equations $a \equiv bx\mod M$ and $c \equiv bx\mod N$ in which I know $a, b, c, M$, and $N$. I am trying to find $MN > x \geq 0$ ($x$ is non-negative). Further, $M$ and $N$ are odd and relatively prime (in my case $M$ and $N$ are odd primes). The solutions to each equations lie on a line with slopes $M$ (or $N$). These lines with different slopes intersect at exactly one point, from which I intend to get the value of $x$. Following is my attempt.
Given $a$ (or $c$), I do $$a + iM \text{ or } c + iN, i = 0, 1, 2, \cdots,$$ until $a + iM \mod b \equiv 0$ (or $c + iN \mod b \equiv 0$). Next, $$x_1 = \frac{a + iM}{b} \text{ and } x_2 = \frac{c + iN}{b}.$$ Then I extend the solution by performing $$x_1 + jM \text{ and } x_2 + kN, j=0, 1, 2, \cdots,$$ such that $x_1$ and $x_2$ are both less than $MN$. I solve the two lines for their intersection.
This works but I wanted to know if there is an easier way to solve this system. I also want to know, if I am missing any solution by performing these operations and if my attempt is right. Thank you!
PS: My question is different from the one here where the equation is of the form $ax \equiv b \mod M$ whereas in my question it is of the form $a \equiv bx \mod M$.
solution-verificationquestion to be on topic you must specify precisely which step in the proof you question, and why so. This site is not meant to be used as a proof checking machine. – Bill Dubuque Dec 10 '24 at 18:44