Equation for # of frames in an animation from color cycling?

One of my favorite uses for the program is for color cycled animations, but minimizing the number of frames for an animated gif can be difficult. I checked the Pro Motion help file for the guidance, which suggests that users will successfully achieve a low frame count when the products of each cycle times its number of colors are factors of each other. In the example:

1. length: 10, speed: 5; length * speed = 10 * 5 = 50
2. length: 20, speed: 10; length * speed = 20 * 10= 200
3. length: 30, speed: 20; length * speed = 30 * 2 = 600

The gradients of this example will synchronize after 120 frames

However it seems especially when the speed and # of colors have few factors in common that this is no longer true, even when the products have a low common factor:

1. length: 16, speed: 6; length * speed = 16 * 6 = 96
2. length: 8, speed: 6; length * speed = 8 * 6= 48

The gradients of this example will synchronize after 2131 frames(!!)

How, precisely, are the number of frames in an animation from color cycling determined?