Drawing on a problem posed by Hertzsprung in 1887, we say that a given
permutation π∈Sn contains the Hertzsprung pattern
σ∈Sk if there is factor π(d+1)π(d+2)⋯π(d+k) of
π such that π(d+1)−σ(1)=⋯=π(d+k)−σ(k). Using a
combination of the Goulden-Jackson cluster method and the transfer-matrix
method we determine the joint distribution of occurrences of any set of
(incomparable) Hertzsprung patterns, thus substantially generalizing earlier
results by Jackson et al. on the distribution of ascending and descending runs
in permutations. We apply our results to the problem of counting permutations
up to pattern-replacement equivalences, and using pattern-rewriting systems --
a new formalism similar to the much studied string-rewriting systems -- we
solve a couple of open problems raised by Linton et al. in 2012