Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. //autor:Andy dela Cruz
  2. //descripcion:proyect euler numero 4
  3.  
  4.  
  5. var numero=1;
  6. var primos=[];
  7.  
  8. var susecion=function(numero){
  9. if(numero>1000){
  10.  
  11. var maximo=primos[primos.length-1];
  12. var minimo=primos[primos.length-2];
  13. var total=(maximo*minimo);
  14. console.log("el numero buscado es"+ total);
  15. console.log ("Los factores primos son " +maximo+" y "+minimo+ ".");
  16. }else{
  17. if(906609%numero===0){
  18. div1=(numero/2);
  19. if(div1%2===0 || div1%3===0 ){
  20. return("error")
  21. }else{
  22. console.log (numero);
  23. primos.push(numero);
  24.  
  25. }
  26. }
  27.  
  28. numero++
  29. susecion(numero)
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement