class NthPrime def initialize @t=[] end def is_prime(n) @t.each do |x| return false if n % x == 0 end return true end def findXthPrime(x) i=2 while @t.length