Suppose $b\mid a$. For positive integers, is $a/b=c\bmod M$ always equivalent (in the if and only if sense) to $a=bc\mod bM$? Is there a better way of removing division from the original equation?
The reason I want to confirm such an equivalence is this: To generate random numbers, the linear congruential generator works as follows $$X_{n+1}=aX_n+c\mod{M}$$where $a$ and $M$ are very large numbers. With a proper choice of $a$ and $c$, the length of the generated sequence (till it starts repeating itself) is $M$; I like to ask students to confirm this numerically. This requires (among other things) verifying that$$\frac{a^M-1}{a-1}c=1\mod{M}$$ Computer systems (such as Maple) find it impossible to evaluate $a^M$ directly, since the number is too large; to be able to proceed, one needs to break the computation into $$(a^{p_1}\mod{M(a-1)})^{p_2}\mod{M(a-1)}...$$and thus continue over all prime factors of $M=p_1p_2...$; since these are normally relatively small numbers, the computation becomes feasible.
If $\frac ab=k$ is an integer and if $\frac ab = m \equiv c\pmod M$ then $mb =a \equiv cb \pmod M$ so it is true in the "if" sense but not in the "only if" sense.
There are a few things to note:
1) If $A \equiv B \pmod {kM}$ then it we also true that $A \equiv B \pmod M$ but the converse need not (but could) be true.
Proof: $A \equiv B\pmod kM\implies$ there is an integer $n$ so that $A = B + n(kM)\implies A= B+ (nk)M\implies $A\equiv B \pmod M$.
The converse $A\equiv B\pmod M \implies$ there is an integer $n$ so that $A=B+nM$ so $A = B + (\frac nk)(kM)$ but $\frac nk$ need not be integer.
But $A\equiv B\pmod M$ does imply that for a $k$ that $A \equiv B + vM\pmod{kM}$ for some $v: 0 \le v < k$.
2) To do division if $ak \equiv bk \pmod M$ we can solve that $a \equiv b \pmod{\frac M{\gcd(k,M)}}$.
Pf: $ak \equiv bk \pmod M \implies$ there is an integer $n$ so that $ak = bk + nM$ so $ak = bk + n\gcd(k,M)\frac M{\gcd(k,M)}$ so $a*\frac {k}{\gcd(k,m)}\equiv b*\frac k{\gcd(k,m)} \pmod {\frac M{\gcd(k,M)}}$ and so $a*v = b*v + w\frac M{\gcd(k,M)}$ where $w$ is some integer and $v=\frac k{\gcd(k,M)}$. So $v|w\frac M{\gcd(k,M)}$ but $\frac k{\gcd(k,M)}$ and $\frac M{\gcd(k,M)}$ are relatively prime. So $v|w\frac M{\gcd(k,M)}$ means that $v|w$ so $a = b + \frac wv\frac M{\gcd(k,M)}$ and $a \equiv b \pmod {\frac M{\gcd(k,M)}}$.
Those two results should allow you to answer any question you ever have.
You can always go from $a \equiv b \pmod M$ to $am \equiv bm \pmod M$ and from $a \equiv b\pmod M$ to $a \equiv b+ vM + \pmod {kM}$.
And you can always go from $a\equiv b\pmod M$ to $\frac ak \equiv \frac bk \pmod {\frac M{\gcd(k,M)}}$ (assuming $k|a$ and $k|b$).