Modulus equation

141 Views Asked by At

I never seem to be able to understand this subject.

"Give an expression for x when x(mod n) = x(mod m), while n and m are positive integers and n < m."

My attempt:

x(mod n) => x = an + c => c = x - an

x(mod m) => x = bm + y => y = x - bm

x(mod n) = x(mod m) when x - an = x - bm

For them to be equal, "an" must equal "bm", but how do I proceed? Or have I taken completely the wrong direction? And if I have taken the wrogn direction, is there a way of thinking in order to solve these problems?

1

There are 1 best solutions below

0
On

So far so good. Of course you want $y = c$. Now express $an$ in terms of the least common multiple of $n$ and $m$. Also note that $0 \le c < n$.