why not install a flash player in your browser so you can use this interactiviy?

A and B are two interlocking cogwheels having p teeth and q teeth respectively where


3qp12

One tooth on B is painted red. Find the values of p and q for which this red tooth on B contacts every gap on the cogwheel A as the wheels rotate.