On Jul 23 2014, Frank Adams-Watters wrote: >If p is a prime, there is some ambiguity as to whether prevprime(p) is >p, or the prime before p. (Similarly for nextprime, of course.) PARI >definitely returns p for these; I think Mathematica does, too. In Maple prevprime(p) is the prime before p, and nextprime(p) is the prime after p. Cheers, Robert Israel