Finding terms in an Arithmetic Progression