% -*- texinfo -*- % @deftypefn {Function File} {} primes (@var{n}) % % Return all primes up to @var{n}. % % The algorithm used is the Sieve of Erastothenes. % % Note that if you need a specific number of primes you can use the % fact the distance from one prime to the next is, on average, % proportional to the logarithm of the prime. Integrating, one finds % that there are about @math{k} primes less than % @tex % $k \log (5 k)$. % @end tex % @ifnottex % k*log(5*k). % @end ifnottex % @seealso{list_primes, isprime} % @end deftypefn