function primes = prime_sieve ( n )
%% prime_sieve.m
%
  prime = ones ( n, 1 );
  prime(1) = 0;
  for i = 2 : n
    if ( prime(i) )
      prime(2*i:i:n) = 0;
    end
  end
%
%  To list the actual prime numbers, ask where prime() is nonzero.
%
  primes = find ( prime );

  return
end
