Finding the term of an arithmetic sequence