Ramanujan's sum is defined as: $$c_q(n)=\sum_{\substack{1\leq a\leq q \\\ (a,q)=1}}\exp\left(\frac{2 \pi ian}{q}\right)$$
Let $\eta_q(n)$ denote the sum of the nth powers of the qth roots of unity: $$\eta_q(n)=\sum_{1\leq a\leq q}\exp\left(\frac{2 \pi ian}{q}\right)$$
Why is it the case that: $\eta_q(n)=\sum_{d\mid q}c_q(n)$? In particular, we know: $$\sum_{d\mid q}c_d(n)=\sum_{d\mid q}\sum_{\substack{1\leq a\leq d \\\ (a,d)=1}}\exp\left(\frac{2\pi ian}{d}\right)$$
but I don't see how this guarantees we sum over all the $q$-th roots of unity $1\leq a\leq q$ especially when the inner sum is over the nth powers of the primitive roots of unity. Please be explicit in your justification.