There are n lights, one at each vertex of a regular $n$-gon. Only one light is on at first, each time you can select some vertices to form a regular $m$-gon($m|n$) and change the state of all lights on these vertices, which is called an operation.
What kind of $n$ makes it possible to turn all lights on after a finite number of operations?
I am trying to abstract the states of all lights into a polynomial whose coefficients are in $\{0,1\}$ and at first $f(x)=1$. Through the unit-root trick as follows,
$$\dfrac1m\sum_{k=0}^{m-1}(e^{\frac{2k\pi i}m})^n=[m|n]$$
we can extract the terms $a_0,a_mx^m,a_{2m}x^{2m},...,a_{m[n/m]}x^{m[n/m]}$ of a polynomial. In fact,
$$\dfrac1m\sum_{k=0}^{m-1}f(xe^{\frac{2k\pi i}m})=\sum_{j=0}^na_jx^j\dfrac1m\sum_{k=0}^{m-1}(e^{\frac{2k\pi i}m})^j=\sum_{j=0}^na_jx_j[m|j]=a_0+a_mx^m+...+a_{m[n/m]}x^{m[n/m]}$$
But I don't know how to flip their coefficients accordingly(from $0$ to $1$ or from $1$ to $0$).
Can anyone give me a hint?
Such $n$ does not exist.
Let the state be $f(x)\in \mathbb{F}_2[x] / (x^n-1)$, suppose we have a regular $m$-gon, then its state can be written as $\frac{x^n-1}{x^{n/m}-1} \cdot x^i$, our question is that, can $1$ be a linear combination of the state of the $m$-gon? That is, we have the equation under the field $\mathbb{F}_2$, $$ 1 = \left(\sum_{m\geq 3, m\mid n} \frac{x^n-1}{x^{n/m}-1} g_m(x)\right) \bmod (x^n-1),$$ for some $g_m(x)$. Then, we can rewrite the equation as $$ 1 = \left(\sum_{m\geq 3, m\mid n} \frac{x^n-1}{x^{n/m}-1} g_m(x)\right) + d(x) (x^n-1), $$ for some $d(x)$. Recall that $\mathbb F_2[x]$ is a principal ideal domain, such solution exists if and only if the greatest common divisor of the polynomials $$ \left\{ \frac{x^n-1}{x^{n/m-1}} : m \geq 3, m\mid n \right\} \cup \{ x^n - 1 \} $$ is $1$. But since in $\mathbb Q[x]$, $x^n-1$ has the decomposition $$ x^n - 1 = \prod_{d\mid n} \Phi_d(x), $$ where $\Phi_d(x)$ is the cyclotomic polynomial, we must have $$ \frac{x^n-1}{x^{n/m}-1} = \prod_{d\mid n, d\nmid \frac n m} \Phi_d(x), $$ then we have $\Phi_n(x) \mid \frac{x^n-1}{x^{n/m}-1}$. Since this holds in $\mathbb Q[x]$ and they are all monic polynomials with integer coefficients, we must have $\Phi_n(x) \mid \frac{x^n-1}{x^{n/m}-1}$ in $\mathbb F_2[x]$.
Then the linear combination must be a multiple of $\Phi_n(x)$, since $\deg \Phi_n(x) = \phi(n) \geq 1$, it cannot be $1$.