SHARE
TWEET

Untitled

a guest Jul 15th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //autor:Andy dela Cruz
  2. var num=1;
  3. var numero=1;
  4. var numerosPrimos=[];
  5.  
  6. var suseción=function(numero){
  7.     if(numero>10000){
  8.         var maximo=numerosPrimos[numerosPrimos.length-1];
  9.         console.log ("El mayor factor primo del número 600851475143 es " + maximo + ".");
  10.     }else{
  11.         if(600851475143%numero===0){
  12.               divisible=(numero/2);
  13.             if(divisible%2===0 || divisible%3===0 ){
  14.                 console.log("no es numero primo");
  15.             }else{
  16.              console.log ('numero primo es: ' + numero);
  17.              numerosPrimos.push(numero);
  18.              num*=numero;
  19.                 }
  20.         }
  21.    
  22.        numero++
  23.        suseción(numero)
  24.     }
  25.  
  26. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top