calculating primes for project euler, moslty