updated problem 6 to include calculations using the closed forms for sums