Iam newbie in JS, can someone explain me why my code only works till n=13?

n=14 or 15 have the same output as n=13.

smallestMult(5) should return 60. -Passed

smallestMult(7) should return 420. -Passed

smallestMult(10) should return 2520. -Passed

smallestMult(13) should return 360360. -Passed

smallestMult(20) should return 232792560. However output is: 677840

```
function smallestMult(n) {
let i;
let cnt = 0;
let bnd = n-1;
let mx = n;
while(cnt != bnd){
for(i = 2; i <= mx; i++){
if(n%i == 0){
cnt++;
}
}
if(cnt != bnd){
cnt = 0;
n = n + mx;}
}
console.log(n);
return n;
}
smallestMult(20);
```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36`

.

**Link to the challenge:**

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