fork download
  1. #require "math"
  2.  
  3. def is_prime(prime)
  4. sqrt = Math.sqrt(prime)
  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. until (primes == 10001)
  18. i+= 2
  19. if(is_prime(i))
  20. primes+=1
  21. end
  22. end
  23. puts i
Success #stdin #stdout 0.39s 4760KB
stdin
Standard input is empty
stdout
104743