From Rosetta Code
This is an example of a library. You may see a list of other libraries used on Rosetta Code at Category:Solutions by Library.

ntheory is Perl module available on CPAN as ntheory or Math::Prime::Util. It adds fast integer number theory functions using either GMP, C, or pure Perl.

Highlights include:

  • Generating and iterating over primes or composites
  • Fast primality tests for both small and large integers
  • Primality proofs including BLS75 and ECPP
  • Primality certificate verification
  • Random primes and random provable primes
  • Integer factoring and DLP
  • Fast prime counts and nth prime using LMO
  • prime count and nth prime approximations and bounds
  • Simple partition, divisor, combination, and permutation iterators