nth_prime for legendre phi, not next_prime