Substitution systems [and sine sums]

Cos[a x] - Cos[b x] has two families of zeros: 2 π n/(a + b) and 2 π n/(b - a). Assuming b > a > 0, the number of zeros from the second family which appear between the n^{th} and (n + 1)^{th} zero from the first family is

(Floor[(n + 1) #] - Floor[n #] &)[(b - a)/(a + b)]

and as discussed on page 903 this sequence can be obtained by applying a sequence of substitution rules. For Sin[a x] + Sin[b x] a more complicated sequence of substitution rules yields the analogous sequence in which -1/2 is inserted in each Floor.