Sum of arithmetic and geometric progression