Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isPrime and factorize are slower than needed #9

Closed
hypirion opened this issue Apr 5, 2013 · 0 comments
Closed

isPrime and factorize are slower than needed #9

hypirion opened this issue Apr 5, 2013 · 0 comments

Comments

@hypirion
Copy link
Owner

hypirion commented Apr 5, 2013

isPrime and factorize generates every prime number below the square root of the input argument. We can get away by creating elements when needed, not at the beginning.

However, this will lead to a recursive dependency on isPrime and addPrime. One has to be sure this doesn't lead to any infinite loops, though it seems likely that it should converge at some point. (Perhaps it already does, I'm not sure.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant