Non-mathematician here. I need help solving a formula with a modulus term.
First some background: I am trying to calculate the hole positions for a dividing head plate, which is a tool used in the field of machining when cutting gears. The idea is that the user will crank an input handle a certain amount, which will precisely rotate an output shaft holding a metal blank disk to be cut into a gear. In the photo below, there are 9 concentric rings. The correct ring is chosen depending on the number of teeth to cut in the blank, and input arm is advanced a calculated number of holes for each gear tooth. These dividing heads are very expensive, and I am making a home-made one. Thus I have to figure out the positions of the holes. (Continued below photo)
In my case, 144 complete turns of the input crank will cause the output to rotate 360 degrees, or 2.5 output degrees per 1 input turn. I want to create a gear with 42 teeth, which means 8.571428571 degrees/tooth and 3.428571429 turns of the input crank. This means that I will need to crank 3 full turns, and 0.428571429 additional turns, which is ~154.29 degrees. This means the input arm advances ~154.29 degrees on the dividing plate each time.
The way this usually works is that the dividing head machine has 2 sector arms on the face of the dividing plate (see the bronze arms in the photos). These would be set to the angle that needs to be advanced each time, ~154.29 degrees in my case. The user starts at the position of one of the arms, and stops at the position of the 2nd arm.
In my example, I created a spreadsheet here that calculates that the angle of the input arm (and thus the location for the hole) for the first 8 teeth are as follows. Notice that tooth #8 wraps, and input arm is back to 0 degrees:
tooth Input arm Degrees Output Degrees
1 0.0 0.00
2 154.3 8.57
3 308.6 17.14
4 102.9 25.71
5 257.1 34.29
6 51.4 42.86
7 205.7 51.43
8 0.0 60.00
And if I graph these out, I get:
So what I REALLY want, is the angle between the red dots in the photo. When I have this, I can generate the dividing plate I need. So I am going to try to write all this in some formulas. But here I am getting lost...
The formula for input turns I (units: turns) to achieve output degrees O (units: degrees) in a machine with a conversion C (units: turns/degree) =
O = I / C
O is Output, in degrees
I is Input, in full turns
C is Conversion factor, in turns/degree
Since the input arm is wrapping, this would involve a modulus operation. In my example, I calculate 7 different angles before the 8th operation returns the input handle back to position of 0 degrees. Thus there are 7 red dots on the image above, and the angle between each dot is:
Angle between red dots = 360 / 7
But how to determine this value of 7 without using an iterative algorithm such as a spreadsheet??
$$\frac{360\ output\ deg}{42\ tooth} * \frac{1\ input\ turn}{2.5\ output\ deg} * \frac{360\ input\ deg}{1\ input\ turn} = 1234.28571\ \frac{input\ deg}{tooth}$$
$$Modulus(1234.28571\ deg,\ 360\ deg) = 154.285714285714286\ deg$$
$$Modulus(154.285714285714286*N,\ 360) = 0$$
In my case N = 7. But how to calculate this, i.e for different cases when cutting gears with different number of teeth?
tl;dr
if Modulus(C*n, 360) = 0, how to calculate value of N. I understand that there are multiples of N that will also work. I just want the first value.
Thanks in advance.

