Using the model of independent pseudoatoms, we have obtained the partition function of a random array in terms of a Mayer function determined by the effective potential representing the pseudoatom. This calculation of the partition function is shown to be exact to second order in the scattering potential. It is also correct in the limit of strong, but slowly varying, potentials. To treat the electron states in a liquid metal, built from the same pseudoatom, assumptions have to be made to deal with the three-atom and higher-order correlation functions. Using a simplified form of the Kirkwood approximation the partition function may again be obtained in terms of the same Mayer function as for the random case, plus the two-body correlation function. Results for the partition function are presented for a model of liquid Be. The conclusion is that the partition function for the liquid metal lies quite close to that of the solid, and the short-range order (or excluded volume) appears to be a major factor in determining the electron states. When this order is lost, the partition function changes greatly and the present calculations lead in this case to a very substantial low-energy tail on the density of states. On the other hand, this tail is found to be very small in the liquid metal. Structure in the density of states near the Fermi level, arising from band overlap in the divalent metal, appears to be reduced, but not removed, on melting.