Sum of first n terms of an arithmetic series