0

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?

Bill Dubuque
  • 282,220
Unknown x
  • 917
  • 1
    Well, obvious $LCM(A,B)-d$ is a solution. The only question is it the smallest non-negative? And you can show that by trying to prove that any two solutions have a difference of a multiple of $LCM(A,B)$. – fleablood Apr 18 '24 at 03:27
  • Lemma 1: If $X\equiv a \pmod A$ and $X\equiv b \pmod A$ then $X+LCM(A,B)\equiv a\pmod A$ and $X+LCM(A,B)\pmod B$. Lemma 2: If $X\equiv Y \equiv a\pmod A$ and $X\equiv Y\equiv b\pmod B$ then $X-Y$ is a multiple of $LCM(A,B)$. Lemma 3: $LCM(A,B)-d \equiv a \pmod A$ and $LCM(A,B)-d\equiv b\pmod B$. Conclusion. $LCM(A,B)-d$ is the only solution between $0$ and $LCM(A,B)$. – fleablood Apr 18 '24 at 03:32
  • 1
    $(m+1)A = (n+1)B = x+d$, this is a Common Multiplier of $A$ and $B$. – peterwhy Apr 18 '24 at 04:01
  • By $,\rm\color{#c00}C$CRT = $\rm\color{#c00}{Constant}$ case CRT in the linked dupe: $$\begin{align}x\equiv a\equiv \color{#c00}{-d}!!\pmod{!A}\ x\equiv b\equiv \color{#c00}{-d}!!\pmod{!B}\end{align}\iff x\equiv \color{#c00}{-d}!!\pmod{{\rm lcm}(A,B)}\qquad$$ – Bill Dubuque Apr 18 '24 at 07:53

0 Answers0