Find primes in a sanic way
Find a file
2016-01-15 21:31:44 +01:00
.gitignore initial commit 2016-01-15 21:19:48 +01:00
main.go 2 is also a prime, so let's add that 2016-01-15 21:31:44 +01:00
primes.txt initial commit 2016-01-15 21:19:48 +01:00
README.md initial commit 2016-01-15 21:19:48 +01:00

primefinder

primefinder is a very, very simple prime number finder that is also amazingly fast. For instance, in about 30 minutes, it managed to get all the primes up to 4,000,000, and it goes far over that. Of course, the lower-level you get, the faster the result it gets, but I'd say that this is already quite a satisfactory result.

The script was written in about 10 minutes, trying to use the least lines as possible. It ended up having 32 lines of code. Sure, there are ways to make it simpler, but I think the one I made is already very, very simple.

Installation

Assuming you have go, it's just

go get git.zxq.co/howl/primefinder

then you will find primefinder in $GOBIN. Easy as that!