Finding the Sum of n terms