You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (n % i === 0) { //check for divisors until sqrt(n), and then double that amount of divisors by 2 (to make up for the other half of each factor pair) to get full amount of divisors
divisors.push(i);
}
}
return divisors.length * 2;
}
function solution() {
let triangularNumber = 1;
let count = 2;
//keep generating triangular numbers in numerical order until one has 500 divisors
while (numberOfDivisors(triangularNumber) < 500) {