nextprime
determine the next largest prime
prevprime
determine the next smallest prime
Calling Sequence
Parameters
Description
Examples
nextprime(n)
prevprime(n)
n
-
integer
The nextprime function returns the smallest prime that is larger than n. The prevprime function returns the largest prime that is less than n.
Error, (in prevprime) there are no primes less than 2
See Also
isprime
ithprime
Nextpoly
Download Help Document