Consider the following manipulations of an infinite series (assume convergence conditions wherever necessary):
$$ \log\left(\prod_m \frac{1}{1-z^{f(m)}}\right) = \sum_{m}\log\left(\frac{1}{1-z^{f(m)}}\right) = \sum_m \sum_{i=1}^\infty \frac{z^{if(m)}}{i} \\= \sum_{n=1}^\infty \frac{z^n}{n}\sum_{d|n}d\cdot |\{m\in X: f(m)=d\}| $$ where $f: X \to \mathbb{N}$ is a well-defined map.
How can the final manipulation of changing the indexing of infinite series make sense? Am I missing something here or there is a simple typo that can be fixed to make the manipulations sensible.