{"id":20054231,"url":"https://github.com/scravy/primes4j","last_synced_at":"2025-07-02T13:05:52.919Z","repository":{"id":57730918,"uuid":"131763927","full_name":"scravy/primes4j","owner":"scravy","description":"Prime numbers up to Integer.MAX_VALUE for Java","archived":false,"fork":false,"pushed_at":"2018-06-23T23:16:06.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T09:17:54.035Z","etag":null,"topics":["java-8","java-library","java8","prime-factorizations","prime-numbers"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scravy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-01T21:15:46.000Z","updated_at":"2019-02-15T11:00:30.000Z","dependencies_parsed_at":"2022-09-26T22:01:40.623Z","dependency_job_id":null,"html_url":"https://github.com/scravy/primes4j","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/scravy/primes4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scravy%2Fprimes4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scravy%2Fprimes4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scravy%2Fprimes4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scravy%2Fprimes4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scravy","download_url":"https://codeload.github.com/scravy/primes4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scravy%2Fprimes4j/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263145837,"owners_count":23420678,"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","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":["java-8","java-library","java8","prime-factorizations","prime-numbers"],"created_at":"2024-11-13T12:39:29.633Z","updated_at":"2025-07-02T13:05:52.895Z","avatar_url":"https://github.com/scravy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# primes4j\n\nThis package has a list of all the prime numbers up to `Integer.MAX_VALUE` (2147483647)\nwhich is itself a prime number. This list contains 105097565 entries. The list consists\nof a sequence of integers each stored as 4 bytes, thus it is 420390260 bytes in memory.\n\nOn top it offers a tiny API to load this list (complete or partially) and for example\nfind the prime factors for a number or check whether a given `int` is prime or not.\n\nThis project is mostly useful for playing around with number theory related problems\nwhich can be computed within the realm of `int` values.\n\n## Maven Coordinates\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ede.scravy\u003c/groupId\u003e\n  \u003cartifactId\u003eprimes4j\u003c/artifactId\u003e\n  \u003cversion\u003e2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage Example (1)\n\n```\nimport de.scravy.primes.Primes;\n\npublic class Example1 {\n  public static void main(final String[] args) {\n    final Primes primes = Primes.load(10000); // only loads 10000 primes which is faster\n    System.out.println(primes.getPrimeFactors(2868)); // prints [2, 2, 3, 239]\n  }\n}\n\n```\n\n## Usage Example (2)\n\n```\nimport de.scravy.primes.Primes;\n\npublic class Example {\n  public static void main(final String[] args) {\n    final Primes primes = Primes.load(); // takes a while as it loads all primes into memory\n    System.out.println(primes.isPrime(Integer.MAX_VALUE)); // prints true\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscravy%2Fprimes4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscravy%2Fprimes4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscravy%2Fprimes4j/lists"}