Next prime (next_prime)
The least prime greater than a number.
How to write it
next_prime(n)
- n
- The number to start after. Takes a number.
Examples
next_prime(100)In the solver,
Open in the solvernext_prime(100)gives101.
Related functions
- nth_prime
The n-th prime, counting 2 as the first.
- previous_prime
The greatest prime less than a number.
- prime_nu
How many distinct primes divide a whole number.
- prime_omega
How many primes divide a whole number, counted with multiplicity.
- prime_pi
How many primes are at most a number.
- is_prime_power
Test whether a whole number is a power of a prime.