seqPrimes function

Sequence of prime numbers

Sequence of prime numbers

Calculates the sequence of prime numbers.

seqPrimes(n)

Arguments

  • n: positive integer representing the number of sequence elements.

Returns

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.

Examples

seqPrimes(10)
  • Maintainer: Bogdan Potanin
  • License: GPL (>= 2)
  • Last published: 2023-11-29

Useful links