Next exercise: How many primes are < 1e9? You can of course use PrimePi in Mathematica, or p: in J. But suppose those functions are not available. How would you compute that in your favorite language?
The erroneous answer 50847478 is cited in various textbooks and even has a name, Bertelsen’s number, memorably described by MathWorld as “an erroneous name erroneously given the erroneous value of π(1e9) = 50847478”. After you solve this, you can compare your answer to *A History of APL in 50 Functions <http://www.jsoftware.com/papers/50/>*, Chapter 46. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
