fork download
  1. require "math"
  2.  
  3. def is_prime(prime)
  4. sqrt = prime.sqrt
  5. i=3
  6. while(i <= sqrt)
  7. if (prime % i == 0)
  8. return false
  9. end
  10. i+= 2
  11. end
  12. return true;
  13. end
  14.  
  15. i=13
  16. primes = 6
  17. begin
  18. i+= 2;
  19. if( is_prime(i) == true )
  20. primes++
  21. end
  22. end while (primes < 10001)
  23. puts i
Runtime error #stdin #stdout 0s 4760KB
stdin
Standard input is empty
stdout
Standard output is empty