Analysis of the atom-number correlation function in a few-atom trap