test only primes less than 1000 for speed increase