Calculating $\phi(100)$ where $\phi$ is the totient function

Well, @Arthur cleared this up for me in the comments, so I'll answer my own question:

$\phi(ab)$ = $\phi(a)$ $\times$ $\phi(b)$, only if a and b are co-prime.

So, while $\phi(100)$ = $\phi(25)$ $\times$ $\phi(4)$ because 25 and 4 are co-primes, $\phi(100)$ = $\phi(5)$ $\times$ $\phi(5)$ $\times$ $\phi(2)$ $\times$ $\phi(2)$ is not true because the 2s are not coprime, and the 5s are not co-prime either.

So, $\phi(100)$ = $\phi(25)$ $\times$ $\phi(4)$.

$\phi(25)$ = 20 (We can evaluate this through the formula $\phi(p^n) = p^{n-1}(p-1)$, so $\phi(5^2) = 5^{1}(4) = 5 \times 4 = 20.

$\phi(4)$ = 2.

$\implies$$\phi(100)$ = $20 \times 2$ = 40.

Thanks to @Arthur and @DreiCleaner for clearing this up, and @J.W.Tanner for suggesting some ways to make this answer better!


As pointed out in the comments, $5$ and $5$ are not coprime, so you cannot use the product rule there. Same for $2$ and $2$. I suggest simply counting directly, as it's rather small numbers involved.

There is, however, also a simple rule for $\phi(a^n)$ you can use, either at that stage for $\phi(4)$ and $\phi(25)$, or immediately for $100=10^2$. If you haven't seen that rule, here is a small pointer to get you started:

How many numbers from 0 to 10 are coprime to 10? How about from 10 to 20? What about from 20 to 30? What about [and so on...]

Finally, is there a difference between being coprime to 10 and coprime to 100?