var sum = 0 for (i = 0; i < 250; i++) { function checkIfPrime() { for (factor = 2; factor < i; factor++) { if (i % factor = 0) {
As per the "Sieve of Eratosthenes", I have implemented the code using JS:
function isPrime(n){ return ((n/2 === 1 || n/3 === 1 || n/5 === 1 || n/7 === 1)?true:(n%2===0 || n%3 === 0 || n%5 ===0 || n%7 === 0)?false:true); }; var val = 250; let outArr = []; for(let i=2;i