require "math"
def is_prime(prime)
sqrt = prime.sqrt
i=3
while(i <= sqrt)
if (prime % i == 0)
return false
end
i+= 2
end
return true;
end
i=13
primes = 6
begin
i+= 2;
if( is_prime(i) == true )
primes++
end
end while (primes < 10001)
puts i
cmVxdWlyZSAibWF0aCIKCmRlZiBpc19wcmltZShwcmltZSkgICAgIAogICAgc3FydCA9IHByaW1lLnNxcnQKCWk9MwoJd2hpbGUoaSA8PSBzcXJ0KSAKICAgICAgICBpZiAocHJpbWUgJSBpID09IDApIAoJCQlyZXR1cm4gZmFsc2UKCQllbmQKCQlpKz0gMgogICAgZW5kCiAgICByZXR1cm4gdHJ1ZTsgCmVuZAogCmk9MTMKcHJpbWVzID0gNgpiZWdpbiAKICAgIGkrPSAyOwogICAgaWYoIGlzX3ByaW1lKGkpID09IHRydWUgKQogICAgICAgIHByaW1lcysrCiAgICBlbmQKZW5kIHdoaWxlIChwcmltZXMgPCAxMDAwMSkKcHV0cyBp