To anyone who is struggling, here's how to get started...

Suppose the teeth counts are a, b and c. We know that b=a+c.

So that's tooth ratios of a : (a+c) : c.

Those are the only two variables you need; you don't need to introduce any more.

Once you get the logic set up, it unfolds beautifully to give the solution, and it's all elementary algebra.

If cog A does 1 revolution... then what?