Your code should work for n up to 2 billion ( 2,000,000,000 ).
Built-ins that trivialize this are not allowed. This includes built in π functions or lists of values for π(n).
Built-ins that test primality or generate primes are not allowed. This includes lists of primes, which may not be looked up externally or hardcoded locally, except with regards to the next bullet point.
You may hardcode primes up to and including 19 and no higher.
your implementation of π should be deterministic. This means that given a specific n, your code should run in (approximately) the same amount of time.
Languages used must be freely available on Linux (Centos 7). Instructions should be included on how to run your code. Include compiler/interpreter details if necessary.
Official times will be from my computer.
When posting, please include a self-measured time on some/all of the test/score cases, just to give me an estimate of how fast your code is running.
Submissions must fit in an answer post to this question.
I am running 64bit centos7. I only have 8GB of RAM and 1GB swap. The cpu model is: AMD FX(tm)-6300 Six-Core Processor.
tags shouldn't go in titles and titles not in challenge bodies. also made the title a bit more expressive.
Martin Ender
- 198.2k
- 67
- 455
- 999