nextprime {gmp}R Documentation

Next prime number

Description

Return next prime number geater than n

Usage

nextprime(n)

Arguments

n Integer

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.

Value

A (probably) prime number

Author(s)

Antoine Lucas

References

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

See Also

isprime

Examples

nextprime(14)

[Package gmp version 0.4-11 Index]