SHARE
TWEET

Untitled

a guest Oct 18th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let sum = 0;
  2.  
  3. for (let a = 2; a < 1e4; a++) {
  4.     if(isPrime(a)) {
  5.         sum += a;
  6.     }
  7. }
  8.  
  9. function isPrime(number) {
  10.     for (let a = 2; a < number; a++) {
  11.         if (number % a === 0) {
  12.             return false
  13.         }
  14.     }
  15.     return true
  16. }
  17. console.log(sum)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top