Find the smallest positive number that when divided by 24 and 16 gives remainder 3

elementary-number-theory

I am elementary school student and the only thing I can do rn is to go and try it with every possible number, but isn't that too much?

Is there equation for this ?

If it was programming I wouldn't have problem doing it, but I can't write down equation for this.

EDIT: One more thing, the number is 51, but how to get it ?

Best Answer

All you need to do is find the Least Common Multiple of $24$ and $16$, which happens to be $48,$ and then add $3$ to that number. Hence, $LCM(24,16)+3=48+3=51.$

Here is an explanation of why this works:

Let $y$ be the smallest positive number that when divided by $24$ and $16$ gives remainder $3.$ Then there are some positive integers $m$ and $n$ (assuming non-zero, otherwise this problem becomes trivial as others have noted) so that $y=24m+3$ and $y=16n+3$. Then we have that $24m+3=16n+3 \implies24m=16n.$ Therefore, we need $24m=16n$ to be as small as possible. This tells us we just need to find the Least Common Multiple of $24$ and $16.$

This process can be applied in general to any remainder and any two divisors. Let $y$ be smallest positive number that when divided by $a$ and $b$ gives remainder $r.$ Then $y=LCM(a,b)+r$

Related Question