previous up next
Go backward to Output Condition
Go up to Top
Go forward to Complete Specification
RISC-Linz logo

Output Condition

Definition: p is the next such number after n.

Option 1: if n is prime, then isNextP(n, n).

isNextP(n, p) : <=>
   n <= p /\ 
   ~(exists n <= q < p: isPrime(q)).

Option 2: even if n is prime, ~isNextP(n, n).

isNextP(n, p) : <=>
   n < p /\ 
   ~(exists n < q < p: isPrime(q)).

Author: Wolfgang Schreiner
Last Modification: October 6, 1999

previous up next