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!
We can indeed view an $n$-faceted rope as $\mathbb Z / n \mathbb Z$ with addition. If $k$ denotes the number of sides we rotate by then the number of sides we colour with one colour is $n / \gcd (n,k)$ which is the size of the subgroup generated by $k$.
As pointed out in the comments by Thomas Andrews, we have $\mathbb Z / k \mathbb Z \cong \mathbb Z / \gcd (n,k) \mathbb Z$. If $\langle k \rangle$ denotes the subgroup generated by $k$ then $\langle k \rangle \cong \mathbb Z / (n / \gcd (n,k)) \mathbb Z$.