Calculation of specific term in an AP