I am trying to understand a particular proof of the fact that $\sum_{d|n}\phi(d)=n$. I've seen different proofs of this statement, but I'm having trouble understanding the following one, given in "A Classical Introduction to Modern Number Theory". It goes as follows
"Consider the n rational numbers $1/n,2/n,...,n/n$. Reduce each to lowest terms; i.e, express each number as a quotient of relatively prime integers. The denominators will all be divisors of n. If d|n, exactly $\phi(d)$ of our numbers will have $d$ in the denominator after reducing to lowest terms"
In particular, I'm having trouble seeing why exactly $\phi(d)$ of the numbers will have d in the denominator. What am I missing?
This is a good step to understand thoroughly, so let's work through it in detail.
What has to be true about the numerator $a$ so that $a/n$ will have denominator $d$ in lowest terms—that is, so that $a/n = b/d$ with $\gcd(b,d)=1$?
So we simply have to count how many integers in the range $\{1,\dots,d\}$ are relatively prime to $d$ ... and that's exactly what $\phi(d)$ measures!