From something I saw in of Jack'D Aurizio's answer a while ago. What is reasoning on why the construction of this function works, the connection of indicator variables and roots of unity? How to to derive it from scratch?
$$f(x)=\frac{1^x+(-1)^x}{2}$$
Is an indicator for when $x$ is divisible by $2$.
$$\frac{1+e^{\frac{2\pi}{3}ix}+e^{\frac{4\pi}{3}i x}}{3}$$
Is an indicator of $x | 3$.
The pattern is,
$$f(x)=\frac{\zeta_1^x+\zeta_2^x+....\zeta_n^x}{n}$$