Primes and Factorization

Use the operation factor to factor integers. It returns an object of type Factored Integer. See Factored for a discussion of the manipulation of factored objects.

The operation prime? returns true or false depending on whether its argument is a prime.

The operation nextPrime returns the least prime number greater than its argument.

The operation prevPrime returns the greatest prime number less than its argument.

To compute all primes between two integers (inclusively), use the operation primes.

You might sometimes want to see the factorization of an integer when it is considered a Gaussian (that is, complex) integer. See Complex for more details.