Finding the terms of an A.P.