Learn R Programming

gmp (version 0.1)

nextprime: Next prime number

Description

Return next prime number geater than n

Usage

nextprime(n)

Arguments

n
Integer

Value

  • A (probably) prime number

Details

This function uses probabilistic algorithm to identify primes. For practical purposes, it's adequat, the chance of a composit passing will be extremely small.

References

Gnu MP Library see http://swox.com/gmp

See Also

isprimeprob

Examples

Run this code
nextprime(14)

Run the code above in your browser using DataLab