Go backward to Input and Output Conditions Go up to Top Go forward to Output Condition |
Definition: p is a prime number.
isPrime(p) : <=> 1 < p /\ ~(exists 1 < n < p: n | p).
A bit more elegant:
isPrime(p) : <=> 1 < p /\ forall 1 < n < p: n not | p.