0
$\begingroup$

Given a set of numbers, I need to find the lowest number that multiplying it with each of the numbers in the set results in a natural number, while being bigger or equal to $N$.

For example, for the numbers $2.2$, $3$ and $4.2$, the result could be $5$, $10$, $15$, etc as they can multiply $2.2$ and $4.2$ and result in natural numbers. Then, I need the lowest one that's higher than a given number.

I'm trying to implement it as a software algorithm in an efficient way. How would I go about doing that?

1 Answers 1

2

First find the least common multiple of the denominators. You have to multiply by that to clear the fractions, so do so. Then if $a$ is the smallest number after multiplying by the LCM, divide $N$ by $a$ and round up to the next whole number. Call that $b$. The multiplier for the original set is $b*LCM$

  • 0
    @shesek: this is the multiplier. So if $b=17$ that is what you multiply by. $3*17=51\gt 50$2012-10-22