generate_n_primes | R Documentation |
Generate a sequence of prime numbers from min
to max
or generate a vector
of the first n
primes. Both functions use a fast implementation of the
Sieve of Eratosthenes.
generate_n_primes(n)
generate_primes(min = 2L, max)
n |
the number of primes to generate. |
min |
the lower bound of the sequence. |
max |
the upper bound of the sequence. |
An integer vector of prime numbers.
Paul Egeler, MS
generate_primes(max = 12)
## [1] 2 3 5 7 11
generate_n_primes(5)
## [1] 2 3 5 7 11
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.