v1
2/7/2023 by hkotsubo -00
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
function somaMultiplos(x, n) {
    var y = Math.floor((n - 1) / x);
    return x * Math.floor((y * (y + 1)) / 2);
}
let n = 100000;
delete caserun single casemove downdrag and drop case


ready



let sum = somaMultiplos(3, n) + somaMultiplos(5, n) - somaMultiplos(15, n);
delete caserun single casemove updrag and drop case


ready



let sum = 0;
for (let i = 0; i <= n; i++) {
  if (i % 3 === 0 || i % 5 === 0) {
    sum += i;
  }
}
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN