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

Sign in to watch this lesson
Advanced - Number Theory · 5:09
Euler's totient φ(n) counts the numbers from 1 to n that share no factor with n; sorting the fractions k/n by reduced denominator shows that the totients of the divisors of n add up to n. It is computed as n·Π(1 − 1/p) in O(√n) for one number or with a sieve for a whole range, and Euler's theorem uses it to shrink huge exponents, with an extra φ(m) when the base shares a factor with the modulus, which is exactly what power towers need.