Finding terms of an Arithmetic Progression