Saturday 27 August 2016

Nan.Numerics.Prime (in Prolog)

Nan.Numerics.Prime/Prolog 1.2.2-beta

A simple prime number library
Copyright 2016 Julio P. Di Egidio
Licensed under GNU GPLv3.


Module prime provides predicates to test (positive integer) numbers for
primality, find divisors and factor numbers, generate prime numbers in some
interval, find consecutive prime numbers, and save/load all prime numbers
up to some value to/from a file or stream.

Implements a variant of the Miller-Rabin primality test that is
deterministic for numbers up to 3317044064679887385961980, otherwise
it is probabilistic with the number of iterations fixed at 20.

NOTE: Since the primality test in use is probabilistic in general, this
library is not suitable for cryptographic applications.

See the README file for more details.

This library was developed and tested with:
SWI-Prolog 7.3.25 -