I was reading Apostle's Analytic Number Theory book and I saw this formula being used in many cases. Why is this true?
$$ \sum_{n=1}^{\infty} \sum_{d|n} f(d,n) = \sum_{d=1}^{\infty} \sum_{n=1}^{\infty} f(d,nd) $$
I don't see the intuition behind it.
Also, will this hold for finite sums, i.e,
$$ \sum_{n=1}^{m} \sum_{d|n} f(d,n) =^{?} \sum_{d=1}^{m} \sum_{n=1}^{m} f(d,nd) $$
Comment:
In (1) we write the index range of $d$ more explicitly.
In (2) we write the index range somewhat more conveniently.
In (3) we change the order of summation.
In (4) we introduce $d^\prime$ using the definition of the divisor $d$.
In (5) we sum over $d^\prime$ instead of $n$. We observe $d^\prime=1$ if $n=d$, $d^\prime=2$ if $n=2d$, etc.