is_prime
and generate_primes
rely on Wilson's theorem to test for a number's primality;
as primality algorithms go, this is actually a very slow approach - in theory. In practice, because of the
limits R institutes around integer sizes, it's fast enough for our needs. For example, 10m numbers, all 2^30-sized,
can be tested for primality using this package in 100ms.