CPKit
v1.6.1

Segmented Sieve

PrimesMedium

Generate prime numbers within a range [L, R] using optimized segmented intervals.

Alt+Shift+3

Configuration Panel

Complexity Indices

Time ComplexityO((R - L + 1) log log R + sqrt(R) log log sqrt(R))
Auxiliary SpaceO(R - L + 1 + sqrt(R))
Conceptual Overview

Segmented Sieve finds primes in a specific range [L, R] using space proportional only to the square root of R, rather than R itself, saving substantial memory.

Source: CP-Algorithms reference guide