Term calculations and sums