help primes

-------------------------------------------------------------------------------

Title

primes -- Generating prime numbres

Syntax

primes #, clear

Description

primes creates a dataset containing the prime numbers up to the specified number. Note that clear is a required option, as primes destroys the dataset currently in memory.

Example

. primes 20, clear . list

+-------+ | prime | |-------| 1. | 2 | 2. | 3 | 3. | 5 | 4. | 7 | 5. | 11 | |-------| 6. | 13 | 7. | 17 | 8. | 19 | +-------+

See also Prime numbers at MathWorld

Contributed by Stas Kolenikov, skolenik at gmail.com