Viridien interview question

question on an aritmetic progression