{"id":33180748,"url":"https://github.com/jp-diegidio/Nan.Numerics.Prime-Prolog","last_synced_at":"2025-11-20T21:04:49.413Z","repository":{"id":200242140,"uuid":"66507943","full_name":"jp-diegidio/Nan.Numerics.Prime-Prolog","owner":"jp-diegidio","description":"A simple prime number library (in Prolog)","archived":false,"fork":false,"pushed_at":"2017-02-05T01:05:07.000Z","size":1640,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-02-15T07:35:22.902Z","etag":null,"topics":["factorization","miller-rabin","primality-test","prime-numbers"],"latest_commit_sha":null,"homepage":"","language":"Prolog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jp-diegidio.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-08-24T23:51:01.000Z","updated_at":"2023-08-03T00:22:15.000Z","dependencies_parsed_at":"2023-10-16T07:04:01.430Z","dependency_job_id":null,"html_url":"https://github.com/jp-diegidio/Nan.Numerics.Prime-Prolog","commit_stats":null,"previous_names":["jp-diegidio/nan.numerics.prime-prolog"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jp-diegidio/Nan.Numerics.Prime-Prolog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jp-diegidio%2FNan.Numerics.Prime-Prolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jp-diegidio%2FNan.Numerics.Prime-Prolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jp-diegidio%2FNan.Numerics.Prime-Prolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jp-diegidio%2FNan.Numerics.Prime-Prolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jp-diegidio","download_url":"https://codeload.github.com/jp-diegidio/Nan.Numerics.Prime-Prolog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jp-diegidio%2FNan.Numerics.Prime-Prolog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285512121,"owners_count":27184314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["factorization","miller-rabin","primality-test","prime-numbers"],"created_at":"2025-11-16T04:00:23.090Z","updated_at":"2025-11-20T21:04:49.406Z","avatar_url":"https://github.com/jp-diegidio.png","language":"Prolog","funding_links":[],"categories":["Math"],"sub_categories":[],"readme":"# A Simple Prime Number Library in Prolog\n\nNan.Numerics.Primes\nNan.Numerics.Primes/Prolog 1.3.0-beta\nA Simple Prime Number Library in Prolog\nCopyright 2016-2017 Julio P. Di Egidio\nLicensed under GNU GPLv3.\nhttp://julio.diegidio.name/Projects/Nan.Numerics.Primes/\nhttps://github.com/jp-diegidio/Nan.Numerics.Primes-Prolog/\n\n=|library(nan_numerics_primes)|=\n\nModule =prime= provides predicates to test (positive integer) numbers for\nprimality, find divisors and factor numbers, generate prime numbers in some\ninterval, find consecutive prime numbers, and save/load all prime numbers\nup to some value to/from a file or stream.\n\nAll predicates in module =prime= are _safe_, i.e. validate input arguments\nand ensure steadfastness.  For maximum performance, user code can directly\ncall the _unsafe_ =public= (not exported) predicates in module =prime_lgc=.\n\nImplements a variant of the *Miller-Rabin* primality test that is\n_deterministic_ for numbers up to =3317044064679887385961980=, otherwise\nit is _probabilistic_ with the number of iterations fixed at =20=.\n\nFor better performance, leverages a prime wheel of level =6=, i.e.\ngenerated by the first =6= prime numbers, and thread-local memoization of\npairs of consecutive prime numbers.\n\n*NOTE*: Since the primality test in use is _probabilistic_ in general, this\nlibrary is not suitable for cryptographic applications.\n\nThis library was developed and tested with:\nSWI-Prolog 7.3.25 - http://www.swi-prolog.org/\n\nUsage example:\n\n    ==\n    ?- pack_install(nan_numerics_primes).\n    true.\n    \n    ?- use_module(library(nan_numerics_primes)).\n    true.\n\n    ?- time(prime_right(1234567891012345678901234567890123456789011111, P)).\n    % 1,227 inferences, 0.000 CPU in 0.010 seconds (0% CPU, Infinite Lips)\n    P = 1234567891012345678901234567890123456789011139.\n    ==\n\nTo be done: Implement parallel factoring functions.\nTo be done: Implement probabilitic test error estimates?\nTo be done: Implement option for num. of probabilistic iterations?\nTo be done: Implement prime counting/n-th prime functions.\nTo be done: Implement deterministic tests?\nTo be done: Improve compatibility with other Prolog systems.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjp-diegidio%2FNan.Numerics.Prime-Prolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjp-diegidio%2FNan.Numerics.Prime-Prolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjp-diegidio%2FNan.Numerics.Prime-Prolog/lists"}