Skip to content

NextPrime

NextPrime(n)

gives the next prime after n.

NextPrime(n, k)

gives the kth prime after n.

Examples

>> NextPrime(10000)
10007
>> NextPrime(100, -5)
73
>> NextPrime(10, -5)
-2
>> NextPrime(100, 5)
113
>> NextPrime(5.5, 100)
563
>> NextPrime(5, 10.5)
NextPrime(5, 10.5)

Implementation status

  • ✅ - full supported

Github