Guest User

Untitled

a guest
Oct 18th, 2019
79
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