A number theory puzzle
You're looking for a function $f:\mathbb{N}\to\mathbb{N}$ such that $\sum_{d\mid n} f(d) = n$ for all $n$.
The key is that this determines $f(n)$ if you know $f(1), f(2), \ldots ,f(n-1)$ already. So if you can find any $g$ that does the job, then $f=g$ follows from induction. How to find such a function?
Hint #1: In a cyclic group with $n$ elements, how many elements of order $d$ are there?
Hint #2: How many $n$-th roots of unity are there? How many of those are primitive $d$-th roots of unity?