{"id":17252050,"url":"https://github.com/ppetr/zillion-primes","last_synced_at":"2025-10-26T00:15:33.122Z","repository":{"id":230564669,"uuid":"769348351","full_name":"ppetr/zillion-primes","owner":"ppetr","description":"Fast implementation of the Sieve of Erathosthenes","archived":false,"fork":false,"pushed_at":"2024-03-30T12:50:39.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T08:44:15.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppetr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-08T21:30:14.000Z","updated_at":"2024-03-30T12:00:56.000Z","dependencies_parsed_at":"2024-04-05T14:48:05.799Z","dependency_job_id":null,"html_url":"https://github.com/ppetr/zillion-primes","commit_stats":null,"previous_names":["ppetr/zillion-primes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppetr%2Fzillion-primes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppetr%2Fzillion-primes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppetr%2Fzillion-primes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppetr%2Fzillion-primes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppetr","download_url":"https://codeload.github.com/ppetr/zillion-primes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245606465,"owners_count":20643186,"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":[],"created_at":"2024-10-15T06:52:54.644Z","updated_at":"2025-10-26T00:15:33.019Z","avatar_url":"https://github.com/ppetr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zillion primes\n\n*Disclaimer:* This is not an officially supported Google product.\n\nThis program uses the [Sieve of\nEratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) to generate\nprimes up to a given bound.\n\nOn a standard low-end Intel Core i5 it produces ~7.9M primes per second.\n\nIt uses approximately _0.024√n_ bytes of RAM to compute primes up to _n._\n\n## Output\n\nThe program emits primes to _stdout_ encoded as 64-bit binary [little-endian]\nnumbers.\n\nThis format is easily readable by programs, and can be even [`mmap`]-ed as an\n`int64_t[]` array. Also allows to quickly read an N-th prime.\n\n[`mmap`]: https://en.wikipedia.org/wiki/Mmap\n[little-endian]: https://en.wikipedia.org/w/index.php?title=Endianness\u0026oldid=1212636685#Numbers\n\n## Compilation\n\n```shell\n$ clang++ -O3 sieve.cc -o sieve\n```\n\n`g++` works just as well, it just produces slightly slower (~15%) binary.\n\n## Testing\n\nThe first 50.000.000 primes should satisfy the following hash:\n\n```sh\n$ ./sieve 982451653 | sha256sum\n17d28fa909939b450dbd6b8923a1001c61bdc8cedb5e44a07f9f90b4d36ab279  -\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppetr%2Fzillion-primes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppetr%2Fzillion-primes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppetr%2Fzillion-primes/lists"}