Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 50s1 days 16 hours 1 minutes 50 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 50s1 days 16 hours 1 minutes 50 seconds.

Sign in to watch this lesson
Algorithms - Bits and Number Theory · 4:25
Trial division tries divisors in order while d squared still fits under n, divides each one out as often as it goes, and reports whatever is left above 1 as a prime. We watch the square-root ceiling drop on 360 and collapse on 4817191, find the worst cases, then cut the candidates with odd numbers, the 2*3*5 wheel and pre-sieved primes (measured on this Mac), and finish with the smallest-prime-factor table from the linear sieve, which factors any number up to N in a logarithmic number of hops.