Colloidal particles dispersed in a liquid form a layer-like structure at a solid-liquid interface. Amano et al. have developed a method to calculate the number density distribution of colloidal particles on a substrate from a colloidal probe atomic force microscopy (CP-AFM) force curve (Amano et al., J. Phys. Chem. B. 122 (2018) 4592). This method assumes that the probe-particle pair potential is rigid. In this paper, we propose a new method to calculate the number density distribution which does not use the assumption. The new method is based on Ornstein-Zernike equations and hyper-netted chain approximation, and the number density distribution is obtained numerically. The new method shows better performance than the previous method. The new method can also calculate the pair potential between colloidal particles and a substrate from a CP-AFM force curve.