Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement