mpz_primorial_ui( ) is a great function. Why not return the actual number of primes that go into that calculation? The argument n is an unsigned long int, and the return argument could be as well. It is often valuable to know that number, and mpz_primorial_ui(...) has done all of the heavy lifting. Thanks.