find primes on a loop