Mathemagic (part the first)

This code snippet on calculating the first n Primes using the Python programming language fell into my RSS feed this morning. Very nice I thought, but then it occurred to me, what would be really fast would be to ask the internet. Or more specifically WolframAlpha. So I did:,000,000,000.

The first 20 of 50,847,324 prime numbers less that 109 are displayed in the internet equivalent of a blink of an eye.
One assumes that Mathematica is doing the sums in an efficient way so you get the benefit of expert algorithm knowledge *and* get right to the answer just by asking the obvious question “primes less than 10,000,000,0000″.
You also get to know how many of them there are, and if you want, you get a PDF listing them that you can use to wallpaper your room.
Prime numbers are very interesting. Wikipedia has a fairly detailed [introduction]( Asking WolframAlpha about “[primes](” gives you some basic information and examples of useful queries and there’s loads of information about Prime Numbers at the Mathematica [Mathworld website]( Marcus du Sautoy talks about prime numbers (the “Atoms of Mathematics”) in [this video]( There are also a number of ways of testing for finding prime numbers using [Prime Factorization]( and many efficient, and less efficient, ways of doing [Prime Factorization with a computer](
Incidentally, is the Python algorithm really the fastest way? What does *Mathematica* do? Answers, with proofs, in the comments!