Professional Documents
Culture Documents
For each integer d greater than 1 and not larger than √n, check if d
divides n.
It takes roughly n divisions in the worst case when n is a product
of two primes of the same size.
Good if n is less than 240
The density of primes is n/lnn, and since primes go up to √n the
complexity is O(√n/ln√n).
𝑞 is prime
𝑞≤𝐵