# Category:Ntheory

**Library**

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

## Pages in category "Ntheory"

The following 200 pages are in this category, out of 200 total.

### A

### C

- Calkin-Wilf sequence
- Carmichael 3 strong pseudoprimes
- Catalan numbers
- Catalan numbers/Pascal's triangle
- Chernick's Carmichael numbers
- Chinese remainder theorem
- Chowla numbers
- Cipolla's algorithm
- Circular primes
- Collect and sort square numbers in ascending order from three lists
- Combinations
- Composite numbers k with no single digit factors whose factors are all substrings of k
- Consecutive primes with ascending or descending differences
- Coprime triplets
- Coprimes
- Count in factors
- Cousin primes
- Cuban primes
- Cubic special primes
- Cullen and Woodall numbers
- Curzon numbers
- Cyclops numbers

### D

### E

### F

- Factorial
- Factorial primes
- Factorions
- Factors of an integer
- Farey sequence
- Faulhaber's triangle
- Fermat numbers
- Fermat pseudoprimes
- Find largest left truncatable prime in a given base
- Find palindromic numbers in both binary and ternary bases
- Find prime n such that reversed n is also prime
- First perfect square in base n with n unique digits
- Fortunate numbers
- Frobenius numbers

### L

### M

### N

- N-smooth numbers
- Negative base numbers
- Neighbour primes
- Next special primes
- Nice primes
- Non-decimal radices/Convert
- Numbers in base 10 that are palindromic in bases 2, 4, and 16
- Numbers which are the cube roots of the product of their proper divisors
- Numbers which binary and ternary digit sum are prime
- Numbers whose count of divisors is prime

### P

- Pairs with common factors
- Palindrome dates
- Pan base non-primes
- Pandigital prime
- Parallel calculations
- Partition an integer x into n primes
- Pascal's triangle
- Pell numbers
- Penta-power prime seeds
- Perfect numbers
- Perfect totient numbers
- Permutations
- Permutations with some identical elements
- Permutations/Derangements
- Permutations/Rank of a permutation
- Pernicious numbers
- Pi
- Pierpont primes
- Piprimes
- Pisano period
- Power set
- Practical numbers
- Primality by Wilson's theorem
- Prime conspiracy
- Prime decomposition
- Prime numbers which contain 123
- Prime triangle
- Prime triplets
- Primes - allocate descendants to their ancestors
- Primes whose first and last number is 3
- Primes whose sum of digits is 25
- Primes with digits in nondecreasing order
- Primes: n*2^m+1
- Primorial numbers
- Product of min and max prime factors
- Proper divisors

### R

### S

- Safe and Sophie Germain primes
- Safe primes and unsafe primes
- Semiprime
- Sequence of primorial primes
- Sequence: nth number with exactly n divisors
- Sequence: smallest number greater than previous term with exactly n divisors
- Sequence: smallest number with exactly n divisors
- Sexy primes
- Sierpinski pentagon
- Smallest number k such that k+2^m is composite for all m less than k
- Smarandache prime-digital sequence
- Smith numbers
- Special divisors
- Special factorials
- Square form factorization
- Square-free integers
- Stern-Brocot sequence
- Strange plus numbers
- Strange unique prime triplets
- Strong and weak primes
- Subset sum problem
- Successive prime differences
- Sum digits of an integer
- Sum of divisors
- Sum of primes in odd positions is prime
- Sum of square and cube digits of an integer are primes
- Sum of two adjacent numbers are primes
- Summarize primes
- Super-Poulet numbers
- Superpermutation minimisation