nextprime - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


nextprime

determine the next largest prime

prevprime

determine the next smallest prime

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

nextprime(n)

prevprime(n)

Parameters

n

-

integer

Description

• 

The nextprime function returns the smallest prime that is larger than n. The prevprime function returns the largest prime that is less than n.

Examples

nextprime1

2

(1)

nextprime0

2

(2)

prevprime2

Error, (in prevprime) there are no primes less than 2

nextprime25

29

(3)

prevprime3

2

(4)

prevprime25

23

(5)

nextprime31243

31247

(6)

prevprime2338714

2338703

(7)

nextprime26

67

(8)

See Also

isprime

ithprime

Nextpoly