Segmented sieve of Eratosthenes can be used to evaluate prime numbers less than n, where n is large enough in pretty less time and memory.
Time complexity: O(n.log(log(n)))
Space complexity: O(sqrt(n))
Link:
Segmented sieve of Eratosthenes
Segmented sieve of Eratosthenes can be used to evaluate prime numbers less than n, where n is large enough in pretty less time and memory.
Time complexity: O(n.log(log(n)))
Space complexity: O(sqrt(n))
Link: