I am trying to come up with a formula to calculate how many rotations of discrete steps I need to converge on the exact same point on a circle. For instance I start at $0$ degrees and rotate $45$ degrees $8$ times to converge back to the $0$ degree marker. Now I am trying to find a formula that will work for any step size $\lt360$ degrees. The closest I can come up with is either one of:
$$1)\qquad (XY) \bmod 360 = 0$$
or
$$2)\qquad \frac{XY}{360} = Z$$
I think it will take a combination of these, the first one to know when I've found a suitable multiple of $360^\circ$ and the second to figure out exactly how many rotations it took. It's been a long time since I have done any trig or formal algebra so a quick refresher or even a nudge in the right direction would be appreciated.
Edit: A bit more info is needed I think. I am trying to figure out if and when a musical scale will become a closed system. A scale is normally generated by continuously stacking an interval until it converges on an octave. An example is that $$ 2^{(\frac{1}{12})} = 1.059463 $$ using the formula $$ 1200 * \frac{\log 2^{(\frac{1}{12})}}{\log 2} = 700 $$ We see that a tempered perfect fifth is exactly 700 cents. To transfer this into degrees we simply do $$ 700 (\frac{360}{1200}) = 210° $$ I know that 210° will converge after 12 steps which will produce exactly 7 rotations on a circle. The complication comes in when an interval is not expressed in cents as an integer. for instance a natural perfect fifth is the ratio $$ 1200 * \frac{\log 2^{(\frac{3}{2})}}{\log 2} = 701.955 $$ Which turns out to be 210.5865°. So I need to figure out how many steps until convergence and how many rotations it would be in total. The GCD method will work for integers but I was hoping for a way to do it with any real number. The results of this method should always produce integers though, but should work for any real number input. I basicly want to short cut the process of actually stacking the intervals.
You won't be able to come out even if the number of degrees is irrational. You can come as close to a multiple of $360^\circ$ as you like, but won't get there. Your value of $2^{\frac 1{12}}$ is not exact, the number is irrational. The formula for a perfect fifth you give is not correct, as $\frac {\log 2^{\frac 32}}{\log 2}=\frac 32$ so $1200 \cdot \frac {\log 2^{\frac 32}}{\log 2}=1800$ It is true that a natural perfect fifth is about $702$ cents
If your number is rational, you can come out even. If it is $\frac ab$ in lowest terms, you need to multiply it by $\frac {ab}{\gcd(a,360)}$ to get the first multiple of $360$. You will make $\frac {360}{\gcd(a,360)}$ full rotations.