=begin By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10001st prime number? =end primes = [] numprimes = 0 checking = 1.0 while true checking += 1 isprime = true primes.each do |p| qt = checking / p if qt == qt.truncate isprime = false break end end if isprime numprimes += 1 primes.push checking.to_f end break if numprimes == 10001 end print(checking)