The (ordinary) generating function whose coeff. of z^n is the weight-enumerator of permutations of length n where the weight of a permutation pi is the product of t[q] to the power of the number of times the consecutive pattern q shows up in pi, for all patterns q of length, 2 equals 1 ----- \ ) g[i](1, z) / ----- i = 1 where the vector of formal power series of length, 1 in the variables, x[1], z is the unique vector that satisfies the following system of functional equations 2 z t[1, 2] x[1] g[1](1, x[1] z) g[1](x[1], z) = x[1] z + ------------------------------- x[1] - 1 z t[2, 1] x[1] g[1](x[1], z) z t[1, 2] x[1] g[1](x[1], z) + ---------------------------- - ---------------------------- x[1] - 1 x[1] - 1 z t[2, 1] x[1] g[1](1, z) - ------------------------- x[1] - 1 This took, 0.142, second