Calculation of the coefficients of the nuclear mass formula