{"id":17212433,"url":"https://github.com/jackfirth/clojure-primes","last_synced_at":"2025-10-15T09:01:46.774Z","repository":{"id":85779231,"uuid":"40842378","full_name":"jackfirth/clojure-primes","owner":"jackfirth","description":"Toy problem for getting familiar with Clojure build tooling and project organization","archived":false,"fork":false,"pushed_at":"2015-08-17T06:37:51.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T18:29:47.473Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackfirth.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":"2015-08-16T21:32:33.000Z","updated_at":"2015-08-16T21:37:47.000Z","dependencies_parsed_at":"2023-03-11T00:16:23.359Z","dependency_job_id":null,"html_url":"https://github.com/jackfirth/clojure-primes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jackfirth/clojure-primes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackfirth%2Fclojure-primes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackfirth%2Fclojure-primes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackfirth%2Fclojure-primes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackfirth%2Fclojure-primes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackfirth","download_url":"https://codeload.github.com/jackfirth/clojure-primes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackfirth%2Fclojure-primes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263472279,"owners_count":23471812,"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-15T03:00:03.081Z","updated_at":"2025-10-15T09:01:46.702Z","avatar_url":"https://github.com/jackfirth.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clojure-primes [![Build Status](https://travis-ci.org/jackfirth/clojure-primes.svg)](https://travis-ci.org/jackfirth/clojure-primes)\n\nToy problem for getting more comfortable with Clojure build tooling and ecosystems. Constructs a list of the first `n` primes, then draws a table of multiplying primes by each other prime.\n\nTo run, clone the repo and `lein run`. The default app prints a table with the first 15 primes. Built with leiningen 2.x, not tested on leiningen 1.x.\n\nTo play around with, clone the repo and `lein repl`, then `(print-prime-table 30)` or however many you want to see.\n\n# Scalability\n\nThe biggest drain on performance is IO to the console. `(print-prime-table 1000)` takes a second or so to draw everything. However, notable time complexities are:\n\n- `O(m(n) n^2)` for constructing the multiplication table, where `n` is the size of the largest prime (not the number of primes). One multiplication per prime pair, with each multiplication taking `m(n)` time (not sure how efficient clojure's implementation of arbitrary precision multiplication is).\n- `O(mod(p) p^2)` for constructing the first `p` primes, where `mod(p)` is the cost of computing `p mod p`. Note that the `n`th prime is approximately `n / log(n)`, thus `O(p) = O(n / log(n))` making linear time in `p` less than linear time in `n` by a logarithmic factor of `n`. The reason there are `p^2` divisions is because the test for checking if a number is prime based on the primes known so far tests *all* primes known so far, instead of starting at 2 and stopping at the square root of `p`. There's not much point to this optimization currently, because it doesn't do anything about the larger multiplication table time and both computations are dwarfed by IO time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackfirth%2Fclojure-primes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackfirth%2Fclojure-primes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackfirth%2Fclojure-primes/lists"}