Crunch Prime Number Generation Example

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().

Find a Sequence of Primes

Enter a number as the start value and the length of the desired sequence, then press Go.

Find a Large Prime

Find a prime of length about N bits. Just enter the desired number of bits and click Go! A prime in byte-array representation will be generated.

The prime numbers generated on this page can be verified using the openssl library, for example: openssl prime NUMBER

« Back to Examples