seqPrimes | R Documentation |
Calculates the sequence of prime numbers.
seqPrimes(n)
n |
positive integer representing the number of sequence elements. |
The function returns a numeric vector containing
first n
prime numbers. The current (naive) implementation of the
algorithm is not efficient in terms of speed so it is suited for low
n < 10000
but requires just O(n) memory usage.
seqPrimes(10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.