p:^:_1 Improved |
initial writing: 2005-06-23 last updated: 2006-02-28 |
The monad p:^:_1 n gives the number of primes less than n , denoted by π(n) in math. When n has extended-precision internal type (integer or rational), the result of p:^:_1 n is an extended-precision integer. Previously, the result of p:^:_1 n was always a machine-word integer.
For example, the sum of all primes less than one million is:
+/ i.&.(p:^:_1) 1000000x 37550402023