SHARE
TWEET

Untitled

a guest Jul 18th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var fact = 1;
  2.     var numero = 1;
  3.     var primos = []
  4.     var sumaPrimos = function (numero) {
  5.         if (numero > 10000) {
  6.             console.log("Suma de números primos:" + fact);
  7.             var maximo = primos[primos.length - 1];
  8.             console.log("el mayor factor primo del número 600851475143 es :" + maximo + ".");
  9.         } else {
  10.             if (600851475143 % numero === 0) {
  11.                 factor = (numero / 2);
  12.                 if (factor % 2 === 0 || factor % 3 === 0) {
  13.                     return ("error")
  14.                 } else {
  15.                     console.log(numero);
  16.                     primos.push(numero);
  17.                     fact *= numero;
  18.                 }
  19.             }
  20.             numero++
  21.             sumaPrimos(numero)
  22.         }
  23.     }
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