Equivalence classes of a circle of n bits upon flipping 3 consecutive 0s to 1s or vice versa Consider a circle of n-bits and define the equivalence relation as follow:
Two configurations A and B of the n-bits circle are equivalent if they can be transformed into each other by performing a sequence of "3-bit flip" operations. 
Here the "3-bit flip" can only flip 3 consecutive 1s to 0s or vice-versa, namely 111<->000.
The question is how to compute the equivalence class of the n-bits string on a circle? Note that the only operation allowed is the "3-bit flip", any other operations such as overall rotation are not allowed in the equivalence relation. I guess that there will be a lot of invariants that characterize the equivalent classes, but I can only construct a small number of them (such as the numbers of 0s module 3). 
Any help is appreciated, thanks in advance.
 A: It's unclear if you consider $n$-bit circular strings up to rotations, and this would affect the answer. Still, in either case a rough idea is as follows.
Transform $111$ to $000$ until no $111$ remains in the string. Then the string is formed by runs of $0$'s separated by $1$ or $11$. Notice that we can move $000$ from one run to a neighboring run with two $3$-bit flips, and so we can assume that there is at most one run of $0$'s of length $\geq 3$. Hence, there are two major types of equivalence classes:


*

*There is no run of $0$'s of length $\geq 3$. Such classes are classified by a sequence of run lengths $(u_1,z_1,\dots,u_k,z_k)$ for some $k\geq 1$, where $u_i\in\{1,2\}$ is the $i$-th run length of $1$'s and $z_i\in\{1,2\}$ is the $i$-th run length of $0$'s, with $u_1+z_1+\dots+u_k+z_k=n$.

*There exists a run of $0$'s of length $\geq 3$. Such classes are classified by a sequence of run lengths $(u_1,z_1,\dots,u_k)$ for some $k\geq 0$, where again $u_i,z_i\in\{1,2\}$, and $u_1+z_1+\dots+u_k\leq n-3$.
