I've done the following, can you tell me if it's correct?
If $n$ is the number of sides of the rope and $k$ is the number of rotation, e.g. $k=0$ for glue each side to itself then I think the number of colours needed is $$ \# \tt{colours} = \gcd (n,k)$$
I think I can view the rope as $G = (\mathbb Z / n \mathbb Z, +)$ and $k$ as an element of $G$. Then the order of $k$ determines how many sides we can reach. In particular, we can reach $n/\gcd(n,k)$ sides with one colour, the size of the subgroup generated by $k$ (which equals the size of the subgroup generated by $\gcd(n,k)$).
Is this right? Thanks for help!