function primes = prime_sieve ( n )

%*****************************************************************************80
%
%% prime_sieve() returns a list of the primes up to N.
%
  prime = ones(n,1);
  prime(1) = 0;
  for i = 2 : n
    if ( prime(i) )
      prime(2*i:i:n) = 0;
    end
  end

  primes = find ( prime );

  return
end
