Ruby prime number generator