3 ms·
More direct calculation: For every distinct prime factor p (so, of 9 is a factor, use 3 not 9), only (p-1)/p of the natural numbers ≤ n are relatively prime to
by lupire 3y ago
More direct calculation:
For every distinct prime factor p (so, of 9 is a factor, use 3 not 9), only (p-1)/p of the natural numbers ≤ n are relatively prime to it. Pime. This overcpunts nothing, since prime factors are relatively prime to each other. (Proving this requires some analysis of remaimders / modular arithmetic. But working an example shows the pattern).
This gives a formula, phi(n = Sum (p_i ^ e^i)) = n • Product ((p_i -1)/p))
This also shows how OP (and maybe the coach) missed the point of math team.