Generates a series of primes numbers in ascending order.
PRIMES(n)
n |
- |
An integer, the maximum prime value. The returned series contains prime numbers less than or equal to n. |
A series, the prime values less than or equal to n.
W1: primes(10)
W1 contains the series {2, 3, 5, 7}.
W1: primes(10)
W2: isprime(W1)
W2 contains the series {1, 1, 1, 1}, indicating that all the values of W1 are prime.
A prime number is a natural number (positive integer) with exactly two divisors, 1 and itself. Thus, 0 and 1 are not prime.