Check done by building up list of primes and only checking for division by primes.