NextPrimeInt( n )
NextPrimeInt
returns the smallest prime which is strictly larger than
the integer n.
Note that NextPrimeInt
uses a probable-primality test (see
IsPrimeInt).
gap> NextPrimeInt( 541 ); 547 gap> NextPrimeInt( -1 ); 2
GAP 3.4.4