A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. There are various methods to determine whether a given number n is prime. The Crunch arbitrary precision arithmetic library uses a combination of the Miller-Rabin primality test and a simple divisor test to find prime numbers. Two functions are demonstrated here, crunch.nextPrime() and crunch.TestPrime().
The prime numbers generated on this page can be verified using the openssl library, for example: openssl prime NUMBER
« Back to Examples