Find the least number that obtained when divided by $A$ and $B$ leaves the remainder $a$ and $b$ respectively. Also $A-a=B-b=d.$
My attempt Answer given is $LCM(A,B)-d.$ I tried to prove using the division algorithm.
Let $x$ be the desired number. By the statement of the question. We have integers $m$ and $n$ such that $$x=mA+a~~~~~~0\leq a<A$$ and $$x=nB+b~~~~~~0\leq b<B$$ (I assumed $A$ and $B$ positive.If not I can take the negative of either $A$ and $B$ or both.)
Hence,
$$mA+a=nB+b.$$ Also we have $A-a=B-b=d\implies a=A-d a~~~ \wedge~~~ b=B-d.$ That is $$mA-nB=b-a=B-A\implies (m+1)A=(n+1)B.$$ I don't know how to proceed? Could you help me?