Did you know ... Search Documentation:
Pack nan_numerics_prime -- prolog/nan_numerics_prime_whl.pl
PublicShow source

Module prime_whl provides low-level predicates to test candidate primality of numbers based on a prime wheel of level 4, i.e. generated by the first 4 consecutive prime numbers.

NOTE: Predicates in this module are not meant for public use.

author
- Julio P. Di Egidio
version
- 1.2.5-beta
license
- GNU GPLv3
To be done
- Implement dynamic wheel with option for level?
 test_(+N:posint, -Cert:boolean) is semidet
True if N is a candidate prime number.

Cert is true if N is certainly prime, otherwise it is false.

 right_(+N:posint, -P:posint, -Cert:boolean) is det
P is the smallest candidate prime number greater than or equal to N.

Cert is true if P is certainly prime, otherwise it is false.

 left_(+N:posint, -P:posint, -Cert:boolean) is semidet
P is the greatest candidate prime number less than or equal to N. Fails if N equals 1.

Cert is true if P is certainly prime, otherwise it is false.

 lev_(-Lev:posint) is det
Lev is the number of consecutive prime numbers starting from 2 that generate this wheel.