write primes to file