calculation of Arithmetic Progression