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_:↵
↵
https://primesieve.org/segmented_sieve.html
↵
↵
Time complexity: O(n.log(log(n)))↵
Space complexity: O(sqrt(n))↵
↵
_Link_:↵
↵
https://primesieve.org/segmented_sieve.html