Figured out how to avoid looping in order to avoid generating the same prime numbers.