The general solution for an arbitrary number of spins, and an arbitrary finite-range interaction, is given by the same general form. In this case, the precise expression for the matrix M is a bit more complex.