Learn R Programming

mnorm (version 1.2.2)

seqPrimes: Sequence of prime numbers

Description

Calculates the sequence of prime numbers.

Usage

seqPrimes(n)

Value

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.

Arguments

n

positive integer representing the number of sequence elements.

Examples

Run this code
seqPrimes(10)

Run the code above in your browser using DataLab