primes: Prime numbers

Description Usage Arguments Details Value Side Effects See Also Examples

View source: R/conf.design.R

Description

Generate a table of prime numbers.

Usage

1
primes(n)

Arguments

n

A positive integer value, or vector or such values.

Details

Uses an elementary sieve method.

Value

A vector of all prime numbers less than the max(n).

NB: 1 is not a prime number!

Side Effects

None

See Also

factorize

Examples

1
2
primes(1:50)
### [1]  2  3  5  7 11 13 17 19 23 29 31 37 41 43 47

Example output

 [1]  2  3  5  7 11 13 17 19 23 29 31 37 41 43 47

conf.design documentation built on May 2, 2019, 4:02 p.m.