number_primes — Computes the list of all primes up to n.
result = number_primes ( n ) result = number_primes ( n , method )
a 1x1 matrix of floating point integers, must be positive, the maximum integer.
a 1x1 matrix of strings, the algorithm to use.
a nx1 matrix of floating point integers, the primes
Returns the list of all primes from 1 up to n, as a row matrix.
The list of algorithms is the following.
Uses a fast Erathostene's Sieve. This implementation is due to Farid BELAHCENE. It requires a lot of memory and may fail if n is too large.
Uses a naive Erathostene's Sieve. It requires a lot of memory and may fail if n is too large.