Cycles and zeta functions

The number of sequences of n cells that can occur repeatedly, corresponding to cycles in the network, is given in terms of the adjacency matrix m by Tr[MatrixPower[m,n]]. These numbers can also be obtained as the coefficients of x^^{n} in the series expansion of x D[Log[ζ[m, x]],x], with the so-called zeta function, which is always a rational function of x, given by

ζ[m_, x_] := 1/Det[IdentityMatrix[Length[m]] - m x]

and corresponds to the product over all cycles of 1/(1-x^^{n}).