Software Arithmetic Progression soluction