Divisible by a and b, but not a*b

309 Views Asked by At

Is it possible to have a scenario where any number n is divisible by and number a and is also divisible by a number b, but is not divisible by a*b

The origin of this question was my way of thinking about the classical FizzBuzz coding problem.

2

There are 2 best solutions below

0
On BEST ANSWER

Take $n=18$, $a=9$, $b=6$ then $ab = 54$

$54$ does not divide $18$.

For it to be true $a$ and $b$ should be coprime.

0
On

Of course. For example $4$ is divisible by $2$ and $4$ but not $8$. However if $a$ and $b$ are coprime the result is true.