Calculation of sums or series