The knowledge of the partition function, Z, of a system of particles adsorbed on a surface is all that is required to determine the occupational characteristics of the adsorbates and the thermodynamic properties of the system. The surface considered is a terrace or a nanotube of arbitrary periodic lattice geometry, L atomic sites in length, and M' sites in the width of the terrace or in the normal cross section of the nanotube. The matrix method introduced in 2007 to obtain Z for the adsorption study of one species of monomers is now generalized to the study of the coadsorption of any number, n, of monomer species. We provide proof that Z can be related to the eigenvalues of a real and non-negative matrix (T matrix) of rank (n + 1)(M), where M is an integer multiple of M'. In the infinite-L limit, we also prove that Z is the largest eigenvalue of the T matrix, raised to the power of (1)/(M). Because the rank of this matrix increases exponentially with M, we develop a technique for its recursive construction applicable to any lattice geometry, which is easily programmed and efficiently adaptable for supercomputing and multiparallel processing. As examples, we consider the coadsorption on square, equilateral triangular, and honeycomb surfaces. This general formulation can now be applied to model a whole new set of experiments involving the coadsorption of two or more monomer species, on terrace or nanotube surfaces with various periodic lattice structures.