**Tell us what’s happening:**

I’m taking a code quiz. My code is working. I’m getting the correct answers. But i’m being warned of a *Potential infinite loop detected*

// 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

// What is the smallest positive number that is evenly divisible by all of the numbers from 1 to num?

**Your code so far**

```
function smallestMult(num) {
let factorial = 1;
for (let j = 1; j < num; j++) {
factorial += factorial * j;
}
let gotIt = false;
let lowestNumber;
for (let k = num; k < factorial; k++) {
for (let m =1; m<=num; m++) {
if (k % m !== 0 ) {
break;
}
if (m === num) gotIt=true;
}
if (gotIt) {
lowestNumber = k;
break;
}
}
return lowestNumber;
}
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0`

.

**Challenge:** Problem 5: Smallest multiple

**Link to the challenge:**

https://www.freecodecamp.org/learn/coding-interview-prep/project-euler/problem-5-smallest-multiple