Calculating the terms of an Arithmetic Progression