Project Euler problem 3, primes array building cancelled, checking when found