Number of primes below a given number

Just for interest, do you need this for Project Euler problems? There, you often need the exact prime count and related quantities for limits such as 10^{12} or 10^{14} etc. There is extensive discussion on these issues in the forums (alas, you need to have solved the problem before you get access to the associated forum). BTW, I use Julia extensively for Project Euler (it is the perfect language for that!), and I have posted prime counting related code in the forums.

Thank you for asking! No, it’s not for Project Euler, which is new to me (but very interesting!). I’m computationally exploring a mathematical structure I call the prime hexagon. If you are still interested, here’s a 4 year old video I made about it … it doesn’t reflect well what I’m up to now, but may give you a rough idea.

3 Likes

I’m sorry. I replied below, but neglected to tag you.

Hello, two years later! I’m considering switching to PrimeSieve.jl (replacing Primes.jl) because I suspect it is far faster for generating very large prime arrays. Have you, by chance, benchmarked them against each other?
Thanks!

PrimeSieve.jl has not been maintained. It’s broken. If it’s not archived, I should do it.

Okay - thanks for getting back.

I very much wouldn’t mind prs to make primes.jl faster :slight_smile: there’s some relatively low hanging fruit

1 Like

We’ve all known that since reading A humble request/challenge :troll:

1 Like

I’d second that!

I’ll have to read up on this!

I think you will find this thread interesting then.

Interesting until it turned into a proof of twin prime conjecture brawl. :slightly_smiling_face:

1 Like