Nan.Numerics.Prime
A simple prime number library
Copyright 2016 Julio P. Di Egidio
Licensed under GNU GPLv3.
http://julio.diegidio.name/
https://github.com/jp-diegidio/Nan.Numerics.Prime-Prolog/
library(nan_numerics_prime)
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 - http://www.swi-prolog.org/