calculate primes