⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 17m 52s17 days 22 hours 17 minutes 52 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 17m 52s17 days 22 hours 17 minutes 52 seconds.

Sign in to watch this lesson
Algorithms - Bits and Number Theory · 4:03
A divisor of n = p1^e1 * p2^e2 * ... is a choice of exponents, so 60 = 2^2 * 3 * 5 becomes a 3 x 2 x 2 block of 12 cubes, one per divisor, and weighting each cube by its value factors the sum as (1+2+4)(1+3)(1+5) = 168. We turn both formulas into an O(sqrt(n)) trial-division routine, avoid the leftover-prime and overflow traps of the closed form, and fill a whole table of divisor sums by adding every d to its multiples in n ln n steps, measured on this Mac against the linear sieve.