r/computerscience • u/Zizosk • Mar 20 '25
New prime algorithm I just made
Hi, I just published a research paper about a new prime generation algorithm that's alot more memory efficient than the sieve of Eratosthenes, and is faster at bigger numbers from some tests I made. Here's the link to the paper : https://doi.org/10.5281/zenodo.15055003 there's also a github link with the open-source python code, what do you think?
102
Upvotes
View all comments
Show parent comment
2
u/could_be_mistaken Mar 21 '25
Yeah, and I think I know why it kept trying to suggest to use a minheap all the time, because you were prompting about primes too, probably. I worked all night and the results are much better than I expected. I can generate close estimates of all primes in what appears to be linear time. It's a ~prime(nth) formula. Deterministic primality checks on the local neighborhood exactly determine all primes very quickly. I'll try your sieve soon!