3 ms·
(1994). The article is a story, about how Roger Hui (who with Kenneth E. Iverson developed the programming language J), set about finding the 10 billionth prim
by svat 6y ago
(1994).
The article is a story, about how Roger Hui (who with Kenneth E. Iverson developed the programming language J), set about finding the 10 billionth prime: by the Prime Number Theorem it should be about 10^10*log(10^10) which is less than 270 billion, so he split the range into 270 parts, and had each of several machines pick up one part and sieve that billion-number range (to count the number of primes), a million integers at a time. After 20 hours (on 60-70 workstations) he had the counts, so knew the exact million-integer range in which the prime occurred, from which the 10 billionth prime turns out to be either 252,097,800,629 (with 2 as the 0th prime) or 252,097,800,623 (with 2 as the 1st prime).
After doing this, he was able to correct an off-by-one count in a table in a printed book, but the real moral of the story is that this is of course a poor way to compute the nth prime for large n: it has been known since the 1800s how to quickly compute pi(x) (the number of primes not greater than x), and using a published algorithm known at the time would have let him find the ten billionth prime in less than 3 minutes instead of thousands of hours of computer time.
That's the article (though I've focused more on the algorithm while it says “this column is not so much an article about programming as it is about computer logistics”), but these days we can just hit up https://www.wolframalpha.com/input/?i=the+ten+billionth+prime https://www.wolframalpha.com/input/?i=the+ten+billionth+prim... or https://primes.utm.edu/nthprime/index.php#nth https://primes.utm.edu/nthprime/index.php#nth or enter "prime(10000000000)" into https://live.sympy.org/ https://live.sympy.org/ (this times out for some reason, though primepi(22801763489) takes less than a minute so you could binary-search manually), or enter "nth_prime(10^10)" into Sage (https://www.sagemath.org/ https://www.sagemath.org/) to get the result pretty much instantly (after it starts up, which takes a while), or....